Skip to content

Commit

Permalink
Merge efa753b into 1cff405
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnekaunisto committed Oct 7, 2019
2 parents 1cff405 + efa753b commit b9a0cb1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 50 deletions.
3 changes: 2 additions & 1 deletion simple_youtube_api/YouTubeVideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def fetch_comment_threads(self, snippet=True, replies=True)\

return comment_threads

def download(self, output_path=None, filename=None, filename_prefix=None):
# TODO: debug issue with default filename
def download(self, output_path=None, filename="default_name", filename_prefix=None):
'''Downloads video
'''
video_url = 'https://youtube.com/watch?v=' + self.id
Expand Down
50 changes: 1 addition & 49 deletions simple_youtube_api/youtube_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os

from simple_youtube_api.Comment import Comment
from simple_youtube_api.youtube_constants import *

from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
Expand All @@ -16,55 +17,6 @@
from oauth2client.tools import run_flow
from oauth2client.file import Storage

DATA_PATH = os.path.dirname(os.path.abspath(__file__))+os.sep + 'data' + os.sep
MAX_YOUTUBE_TITLE_LENGTH = 100
MAX_YOUTUBE_DESCRIPTION_LENGTH = 5000
MAX_YOUTUBE_TAGS_LENGTH = 500
YOUTUBE_CATEGORIES = {'film': 1, 'animation': 1,
'autos': 2, 'vehicles': 2,
'music': 10,
'pets': 15, 'animals': 15,
'sports': 17,
'short movies': 18,
'travel': 19, 'events': 19,
'gaming': 20,
'videoblogging': 21,
'people': 22, 'blogs': 22,
'comedy': 23,
'entertainment': 24,
'news': 25, 'politics': 25,
'howto': 26, 'style': 26,
'education': 27,
'science': 28, 'technology': 28,
'nonprofits': 29, 'activism': 29,
'movies': 30,
'anime': 31, 'animation': 31,
'action': 32, 'adventure': 32,
'classics': 33,
'comedy': 34,
'documentary': 35,
'drama': 36,
'family': 37,
'foreign': 38,
'horror': 39,
'sci-fi': 40, 'fantasy': 40,
'thriller': 41,
'shorts': 42,
'shows': 43,
'trailers': 44}

YOUTUBE_LICENCES = ['creativeCommon', 'youtube']

SCOPES = ['https://www.googleapis.com/auth/youtube',
'https://www.googleapis.com/auth/youtube.force-ssl',
'https://www.googleapis.com/auth/youtube.readonly',
'https://www.googleapis.com/auth/youtube.upload',
'https://www.googleapis.com/auth/youtubepartner',
'https://www.googleapis.com/auth/youtubepartner-channel-audit']
API_SERVICE_NAME = 'youtube'
API_VERSION = 'v3'
VALID_PRIVACY_STATUS = ('public', 'private', 'unlisted')


# autogenerate code, do not edit
def parse_youtube_video(video, data):
Expand Down
59 changes: 59 additions & 0 deletions simple_youtube_api/youtube_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import os

DATA_PATH = os.path.dirname(os.path.abspath(__file__))+os.sep + 'data' + os.sep
MAX_YOUTUBE_TITLE_LENGTH = 100
MAX_YOUTUBE_DESCRIPTION_LENGTH = 5000
MAX_YOUTUBE_TAGS_LENGTH = 500
YOUTUBE_CATEGORIES = {'film': 1, 'animation': 1,
'autos': 2, 'vehicles': 2,
'music': 10,
'pets': 15, 'animals': 15,
'sports': 17,
'short movies': 18,
'travel': 19, 'events': 19,
'gaming': 20,
'videoblogging': 21,
'people': 22, 'blogs': 22,
'comedy': 23,
'entertainment': 24,
'news': 25, 'politics': 25,
'howto': 26, 'style': 26,
'education': 27,
'science': 28, 'technology': 28,
'nonprofits': 29, 'activism': 29,
'movies': 30,
'anime': 31, 'animation': 31,
'action': 32, 'adventure': 32,
'classics': 33,
'comedy': 34,
'documentary': 35,
'drama': 36,
'family': 37,
'foreign': 38,
'horror': 39,
'sci-fi': 40, 'fantasy': 40,
'thriller': 41,
'shorts': 42,
'shows': 43,
'trailers': 44}

YOUTUBE_LICENCES = ['creativeCommon', 'youtube']

SCOPE_YOUTUBE = 'youtube'
SCOPES = ['https://www.googleapis.com/auth/youtube',
'https://www.googleapis.com/auth/youtube.force-ssl',
'https://www.googleapis.com/auth/youtube.readonly',
'https://www.googleapis.com/auth/youtube.upload',
'https://www.googleapis.com/auth/youtubepartner',
'https://www.googleapis.com/auth/youtubepartner-channel-audit']
API_SERVICE_NAME = 'youtube'
API_VERSION = 'v3'
VALID_PRIVACY_STATUS = ('public', 'private', 'unlisted')


SCOPES = ['https://www.googleapis.com/auth/youtube',
'https://www.googleapis.com/auth/youtube.force-ssl',
'https://www.googleapis.com/auth/youtube.readonly',
'https://www.googleapis.com/auth/youtube.upload',
'https://www.googleapis.com/auth/youtubepartner',
'https://www.googleapis.com/auth/youtubepartner-channel-audit']

0 comments on commit b9a0cb1

Please sign in to comment.