This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from shuffle import youtube_object | |
@app.route('/home', methods=['GET', 'POST']) | |
def home(): | |
category_data = current_user.category | |
choices=category_data.split(',') | |
playlist=[] | |
for choice in choices: | |
try: | |
videos = youtube_object.videos().list( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apiclient.discovery import build | |
DEVELOPER_KEY = "developer key" | |
YOUTUBE_API_SERVICE_NAME = "youtube" | |
YOUTUBE_API_VERSION = "v3" | |
youtube_object = build(YOUTUBE_API_SERVICE_NAME, | |
YOUTUBE_API_VERSION, | |
developerKey=DEVELOPER_KEY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask_wtf import FlaskForm | |
from wtforms import StringField, PasswordField, SubmitField, BooleanField, SelectMultipleField, widgets | |
from wtforms.validators import DataRequired, Length, Email, EqualTo, ValidationError | |
from flask_wtf.file import FileField, FileAllowed | |
from flask_login import current_user | |
from shuffle.models import User | |
from shuffle import youtube_object | |
def youtube_video_categories(): | |
video_category = youtube_object.videoCategories( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
import requests | |
from bs4 import BeautifulSoup | |
import dateutil.parser | |
import pandas as pd | |
import plotly | |
from plotly import graph_objs as go | |
import json | |
app = Flask(__name__) |