diff --git a/youtube-dl.sig b/youtube-dl.sig new file mode 100644 index 000000000..d866f04dd Binary files /dev/null and b/youtube-dl.sig differ diff --git a/youtube_dl/extractor/freetv.py b/youtube_dl/extractor/freetv.py new file mode 100644 index 000000000..d305f2d09 --- /dev/null +++ b/youtube_dl/extractor/freetv.py @@ -0,0 +1,38 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class FreeTVIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?yourextractor\.com/watch/(?P[0-9]+)' + _TEST = { + 'url': 'https://yourextractor.com/watch/42', + 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', + 'info_dict': { + 'id': '42', + 'ext': 'mp4', + 'title': 'Video title goes here', + 'thumbnail': r're:^https?://.*\.jpg$', + # TODO more properties, either as: + # * A value + # * MD5 checksum; start the string with md5: + # * A regular expression; start the string with re: + # * Any Python type (for example int or float) + } + } + + def _real_extract(self, url): + display_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + # TODO more code goes here, for example ... + title = self._html_search_regex(r'

(.+?)

', webpage, 'title') + + return { + 'id': video_id, + 'title': title, + 'description': self._og_search_description(webpage), + 'uploader': self._search_regex(r']+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), + # TODO more properties (see youtube_dl/extractor/common.py) + } \ No newline at end of file diff --git a/youtube_dl/extractor/googledrive.py b/youtube_dl/extractor/googledrive.py index d706fa968..48d9c8b4b 100644 --- a/youtube_dl/extractor/googledrive.py +++ b/youtube_dl/extractor/googledrive.py @@ -13,6 +13,7 @@ from ..utils import ( lowercase_escape, try_get, update_url_query, + unified_strdate, ) class GoogleDriveIE(InfoExtractor): @@ -164,7 +165,7 @@ class GoogleDriveIE(InfoExtractor): def _call_api(self, video_id): - # Call Google Drive API + # Call Google Drive API json_data = self._download_json('https://www.googleapis.com/drive/v3/files/%s?fields=createdTime,modifiedTime,owners&key=%s' % (video_id, self._API_KEY), video_id) print("_real_extract json_data: ", json_data) return json_data @@ -178,11 +179,15 @@ class GoogleDriveIE(InfoExtractor): video_info = compat_parse_qs(self._download_webpage( 'https://drive.google.com/get_video_info', video_id, query={'docid': video_id})) - # print("_real_extract video_info: ", video_info) + json_data = self._call_api(video_id) createdTime = json_data['createdTime'] modifiedTime = json_data['modifiedTime'] - print("createdTime: ", createdTime) + + owner_lst = [] + for owner in json_data['owners']: + owner_lst.append(owner['displayName']) + def get_value(key): return try_get(video_info, lambda x: x[key][0])