([^<]+)<', webpage, 'description', fatal=False)
- video_urls = list(map(compat_urllib_parse.unquote , re.findall(r'flashvars\.quality_[0-9]{3}p = "([^"]+)', webpage)))
+ video_urls = list(map(compat_urllib_parse.unquote, re.findall(r'flashvars\.quality_[0-9]{3}p = "([^"]+)', webpage)))
if webpage.find('flashvars\.encrypted = "true"') != -1:
password = self._html_search_regex(r'flashvars\.video_title = "([^"]+)', webpage, 'password').replace('+', ' ')
video_urls = list(map(lambda s: aes_decrypt_text(s, password, 32).decode('utf-8'), video_urls))
diff --git a/youtube_dl/extractor/spiegel.py b/youtube_dl/extractor/spiegel.py
index 9156d7faf..fa1349fe4 100644
--- a/youtube_dl/extractor/spiegel.py
+++ b/youtube_dl/extractor/spiegel.py
@@ -15,14 +15,14 @@ class SpiegelIE(InfoExtractor):
'title': 'Vulkanausbruch in Ecuador: Der "Feuerschlund" ist wieder aktiv',
},
},
- {
- 'url': 'http://www.spiegel.de/video/schach-wm-videoanalyse-des-fuenften-spiels-video-1309159.html',
- 'file': '1309159.mp4',
- 'md5': 'f2cdf638d7aa47654e251e1aee360af1',
- 'info_dict': {
- 'title': 'Schach-WM in der Videoanalyse: Carlsen nutzt die Fehlgriffe des Titelverteidigers',
- },
- }]
+ {
+ 'url': 'http://www.spiegel.de/video/schach-wm-videoanalyse-des-fuenften-spiels-video-1309159.html',
+ 'file': '1309159.mp4',
+ 'md5': 'f2cdf638d7aa47654e251e1aee360af1',
+ 'info_dict': {
+ 'title': 'Schach-WM in der Videoanalyse: Carlsen nutzt die Fehlgriffe des Titelverteidigers',
+ },
+ }]
def _real_extract(self, url):
m = re.match(self._VALID_URL, url)
diff --git a/youtube_dl/extractor/stanfordoc.py b/youtube_dl/extractor/stanfordoc.py
index 44c52c718..56158dfaa 100644
--- a/youtube_dl/extractor/stanfordoc.py
+++ b/youtube_dl/extractor/stanfordoc.py
@@ -26,7 +26,7 @@ class StanfordOpenClassroomIE(InfoExtractor):
if mobj is None:
raise ExtractorError(u'Invalid URL: %s' % url)
- if mobj.group('course') and mobj.group('video'): # A specific video
+ if mobj.group('course') and mobj.group('video'): # A specific video
course = mobj.group('course')
video = mobj.group('video')
info = {
@@ -46,7 +46,7 @@ class StanfordOpenClassroomIE(InfoExtractor):
raise ExtractorError(u'Invalid metadata XML file')
info['ext'] = info['url'].rpartition('.')[2]
return [info]
- elif mobj.group('course'): # A course page
+ elif mobj.group('course'): # A course page
course = mobj.group('course')
info = {
'id': course,
@@ -56,13 +56,13 @@ class StanfordOpenClassroomIE(InfoExtractor):
}
coursepage = self._download_webpage(url, info['id'],
- note='Downloading course info page',
- errnote='Unable to download course info page')
+ note='Downloading course info page',
+ errnote='Unable to download course info page')
info['title'] = self._html_search_regex('
([^<]+)
', coursepage, 'title', default=info['id'])
info['description'] = self._html_search_regex('
([^<]+)',
- coursepage, u'description', fatal=False)
+ coursepage, u'description', fatal=False)
links = orderedSet(re.findall('
', coursepage))
info['list'] = [
@@ -70,13 +70,13 @@ class StanfordOpenClassroomIE(InfoExtractor):
'type': 'reference',
'url': 'http://openclassroom.stanford.edu/MainFolder/' + unescapeHTML(vpage),
}
- for vpage in links]
+ for vpage in links]
results = []
for entry in info['list']:
assert entry['type'] == 'reference'
results += self.extract(entry['url'])
return results
- else: # Root page
+ else: # Root page
info = {
'id': 'Stanford OpenClassroom',
'type': 'playlist',
@@ -86,7 +86,7 @@ class StanfordOpenClassroomIE(InfoExtractor):
rootURL = 'http://openclassroom.stanford.edu/MainFolder/HomePage.php'
rootpage = self._download_webpage(rootURL, info['id'],
- errnote=u'Unable to download course info page')
+ errnote=u'Unable to download course info page')
info['title'] = info['id']
@@ -96,7 +96,7 @@ class StanfordOpenClassroomIE(InfoExtractor):
'type': 'reference',
'url': 'http://openclassroom.stanford.edu/MainFolder/' + unescapeHTML(cpage),
}
- for cpage in links]
+ for cpage in links]
results = []
for entry in info['list']:
diff --git a/youtube_dl/extractor/steam.py b/youtube_dl/extractor/steam.py
index 91658f892..fd72c11db 100644
--- a/youtube_dl/extractor/steam.py
+++ b/youtube_dl/extractor/steam.py
@@ -24,7 +24,7 @@ class SteamIE(InfoExtractor):
u"md5": u"f870007cee7065d7c76b88f0a45ecc07",
u"info_dict": {
u"title": u"Terraria 1.1 Trailer",
- u'playlist_index': 1,
+ u'playlist_index': 1,
}
},
{
@@ -38,7 +38,6 @@ class SteamIE(InfoExtractor):
]
}
-
@classmethod
def suitable(cls, url):
"""Receives a URL and returns True if suitable for this IE."""
@@ -67,7 +66,7 @@ class SteamIE(InfoExtractor):
thumbsRE = r'
'
thumbs = re.finditer(thumbsRE, webpage)
videos = []
- for vid,vtitle,thumb in zip(mweb,titles,thumbs):
+ for vid, vtitle, thumb in zip(mweb, titles, thumbs):
video_id = vid.group('videoID')
title = vtitle.group('videoName')
video_url = vid.group('videoURL')
@@ -75,11 +74,11 @@ class SteamIE(InfoExtractor):
if not video_url:
raise ExtractorError(u'Cannot find video url for %s' % video_id)
info = {
- 'id':video_id,
- 'url':video_url,
+ 'id': video_id,
+ 'url': video_url,
'ext': 'flv',
'title': unescapeHTML(title),
'thumbnail': video_thumb
- }
+ }
videos.append(info)
return [self.playlist_result(videos, gameID, game_title)]
diff --git a/youtube_dl/extractor/subtitles.py b/youtube_dl/extractor/subtitles.py
index db33745c1..5373ce8b9 100644
--- a/youtube_dl/extractor/subtitles.py
+++ b/youtube_dl/extractor/subtitles.py
@@ -7,6 +7,7 @@ from ..utils import (
class SubtitlesInfoExtractor(InfoExtractor):
+
@property
def _have_to_download_any_subtitles(self):
return any([self._downloader.params.get('writesubtitles', False),
diff --git a/youtube_dl/extractor/techtalks.py b/youtube_dl/extractor/techtalks.py
index a55f236cb..b72b9a317 100644
--- a/youtube_dl/extractor/techtalks.py
+++ b/youtube_dl/extractor/techtalks.py
@@ -37,17 +37,17 @@ class TechTalksIE(InfoExtractor):
talk_id = mobj.group('id')
webpage = self._download_webpage(url, talk_id)
rtmp_url = self._search_regex(r'netConnectionUrl: \'(.*?)\'', webpage,
- u'rtmp url')
+ u'rtmp url')
play_path = self._search_regex(r'href=\'(.*?)\' [^>]*id="flowplayer_presenter"',
- webpage, u'presenter play path')
+ webpage, u'presenter play path')
title = clean_html(get_element_by_attribute('class', 'title', webpage))
video_info = {
- 'id': talk_id,
- 'title': title,
- 'url': rtmp_url,
- 'play_path': play_path,
- 'ext': 'flv',
- }
+ 'id': talk_id,
+ 'title': title,
+ 'url': rtmp_url,
+ 'play_path': play_path,
+ 'ext': 'flv',
+ }
m_slides = re.search(r'playlists)/(?P\d+)) # We have a playlist
|
@@ -36,15 +36,14 @@ class TEDIE(SubtitlesInfoExtractor):
return re.match(cls._VALID_URL, url, re.VERBOSE) is not None
def _real_extract(self, url):
- m=re.match(self._VALID_URL, url, re.VERBOSE)
+ m = re.match(self._VALID_URL, url, re.VERBOSE)
if m.group('type_talk'):
return self._talk_info(url)
- else :
- playlist_id=m.group('playlist_id')
- name=m.group('name')
- self.to_screen(u'Getting info of playlist %s: "%s"' % (playlist_id,name))
- return [self._playlist_videos_info(url,name,playlist_id)]
-
+ else:
+ playlist_id = m.group('playlist_id')
+ name = m.group('name')
+ self.to_screen(u'Getting info of playlist %s: "%s"' % (playlist_id, name))
+ return [self._playlist_videos_info(url, name, playlist_id)]
def _playlist_videos_info(self, url, name, playlist_id):
'''Returns the videos of the playlist'''
@@ -67,7 +66,7 @@ class TEDIE(SubtitlesInfoExtractor):
def _talk_info(self, url, video_id=0):
"""Return the video for the talk in the url"""
- m = re.match(self._VALID_URL, url,re.VERBOSE)
+ m = re.match(self._VALID_URL, url, re.VERBOSE)
video_name = m.group('name')
webpage = self._download_webpage(url, video_id, 'Downloading \"%s\" page' % video_name)
self.report_extraction(video_name)
@@ -75,11 +74,11 @@ class TEDIE(SubtitlesInfoExtractor):
title = self._html_search_regex(r'(?P.*)',
webpage, 'title')
json_data = self._search_regex(r'var talkDetails = ({.*?})',
- webpage, 'json data')
+ webpage, 'json data')
info = json.loads(json_data)
desc = self._html_search_regex(r'.*?
(.*?)',
- webpage, 'description', flags = re.DOTALL)
-
+ webpage, 'description', flags=re.DOTALL)
+
thumbnail = self._search_regex(r'[\s.]* [\s.]*
(?:[^<]+)',
webpage, 'uploader id', fatal=False)
ext = determine_ext(video_url)
-
+
return {
- 'id': video_id,
- 'url': video_url,
- 'uploader': uploader,
+ 'id': video_id,
+ 'url': video_url,
+ 'uploader': uploader,
'uploader_id': uploader_id,
- 'title': title,
- 'ext': ext,
+ 'title': title,
+ 'ext': ext,
}
diff --git a/youtube_dl/extractor/tinypic.py b/youtube_dl/extractor/tinypic.py
index 2246d27b2..cd3045e69 100644
--- a/youtube_dl/extractor/tinypic.py
+++ b/youtube_dl/extractor/tinypic.py
@@ -26,9 +26,9 @@ class TinyPicIE(InfoExtractor):
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id, 'Downloading page')
-
+
mobj = re.search(r'(?m)fo\.addVariable\("file",\s"(?P
[\da-z]+)"\);\n'
- '\s+fo\.addVariable\("s",\s"(?P\d+)"\);', webpage)
+ '\s+fo\.addVariable\("s",\s"(?P\d+)"\);', webpage)
if mobj is None:
raise ExtractorError('Video %s does not exist' % video_id, expected=True)
@@ -47,4 +47,4 @@ class TinyPicIE(InfoExtractor):
'url': video_url,
'thumbnail': thumbnail,
'title': title
- }
\ No newline at end of file
+ }
diff --git a/youtube_dl/extractor/traileraddict.py b/youtube_dl/extractor/traileraddict.py
index 11407428b..1c53a3fd0 100644
--- a/youtube_dl/extractor/traileraddict.py
+++ b/youtube_dl/extractor/traileraddict.py
@@ -25,7 +25,7 @@ class TrailerAddictIE(InfoExtractor):
webpage = self._download_webpage(url, name)
title = self._search_regex(r'(.+?)',
- webpage, 'video title').replace(' - Trailer Addict','')
+ webpage, 'video title').replace(' - Trailer Addict', '')
view_count_str = self._search_regex(
r'([0-9,.]+)',
webpage, 'view count', fatal=False)
@@ -43,12 +43,12 @@ class TrailerAddictIE(InfoExtractor):
fvar = "fvar"
info_url = "http://www.traileraddict.com/%s.php?tid=%s" % (fvar, str(video_id))
- info_webpage = self._download_webpage(info_url, video_id , "Downloading the info webpage")
+ info_webpage = self._download_webpage(info_url, video_id, "Downloading the info webpage")
final_url = self._search_regex(r'&fileurl=(.+)',
- info_webpage, 'Download url').replace('%3F','?')
+ info_webpage, 'Download url').replace('%3F', '?')
thumbnail_url = self._search_regex(r'&image=(.+?)&',
- info_webpage, 'thumbnail url')
+ info_webpage, 'thumbnail url')
description = self._html_search_regex(
r'(?s).*?
]*>(.*?)
',
diff --git a/youtube_dl/extractor/trilulilu.py b/youtube_dl/extractor/trilulilu.py
index d64aaa41f..2f2c8aeda 100644
--- a/youtube_dl/extractor/trilulilu.py
+++ b/youtube_dl/extractor/trilulilu.py
@@ -39,7 +39,7 @@ class TriluliluIE(InfoExtractor):
format_url, video_id,
note=u'Downloading formats',
errnote=u'Error while downloading formats')
-
+
video_url_template = (
u'http://fs%(server)s.trilulilu.ro/stream.php?type=video'
u'&source=site&hash=%(hash)s&username=%(userid)s&'
@@ -63,4 +63,3 @@ class TriluliluIE(InfoExtractor):
'description': description,
'thumbnail': thumbnail,
}
-
diff --git a/youtube_dl/extractor/tube8.py b/youtube_dl/extractor/tube8.py
index 3ec9442c9..0e3377fd5 100644
--- a/youtube_dl/extractor/tube8.py
+++ b/youtube_dl/extractor/tube8.py
@@ -10,6 +10,7 @@ from ..aes import (
aes_decrypt_text
)
+
class Tube8IE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:www\.)?(?P
tube8\.com/.+?/(?P\d+)/?)$'
_TEST = {
@@ -17,8 +18,8 @@ class Tube8IE(InfoExtractor):
u'file': u'229795.mp4',
u'md5': u'e9e0b0c86734e5e3766e653509475db0',
u'info_dict': {
- u"description": u"hot teen Kasia grinding",
- u"uploader": u"unknown",
+ u"description": u"hot teen Kasia grinding",
+ u"uploader": u"unknown",
u"title": u"Kasia music video",
u"age_limit": 18,
}
@@ -41,7 +42,7 @@ class Tube8IE(InfoExtractor):
thumbnail = thumbnail.replace('\\/', '/')
video_url = self._html_search_regex(r'"video_url":"([^"]+)', webpage, u'video_url')
- if webpage.find('"encrypted":true')!=-1:
+ if webpage.find('"encrypted":true') != -1:
password = self._html_search_regex(r'"video_title":"([^"]+)', webpage, u'password')
video_url = aes_decrypt_text(video_url, password, 32).decode('utf-8')
path = compat_urllib_parse_urlparse(video_url).path
diff --git a/youtube_dl/extractor/tudou.py b/youtube_dl/extractor/tudou.py
index 7a3891b89..aabddb249 100644
--- a/youtube_dl/extractor/tudou.py
+++ b/youtube_dl/extractor/tudou.py
@@ -16,23 +16,23 @@ class TudouIE(InfoExtractor):
u"title": u"卡马乔国足开大脚长传冲吊集锦"
}
},
- {
- u'url': u'http://www.tudou.com/albumplay/TenTw_JgiPM/PzsAs5usU9A.html',
- u'file': u'todo.mp4',
- u'md5': u'todo.mp4',
- u'info_dict': {
- u'title': u'todo.mp4',
- },
- u'add_ie': [u'Youku'],
- u'skip': u'Only works from China'
- }]
+ {
+ u'url': u'http://www.tudou.com/albumplay/TenTw_JgiPM/PzsAs5usU9A.html',
+ u'file': u'todo.mp4',
+ u'md5': u'todo.mp4',
+ u'info_dict': {
+ u'title': u'todo.mp4',
+ },
+ u'add_ie': [u'Youku'],
+ u'skip': u'Only works from China'
+ }]
- def _url_for_id(self, id, quality = None):
- info_url = "http://v2.tudou.com/f?id="+str(id)
+ def _url_for_id(self, id, quality=None):
+ info_url = "http://v2.tudou.com/f?id=" + str(id)
if quality:
info_url += '&hd' + quality
webpage = self._download_webpage(info_url, id, "Opening the info webpage")
- final_url = self._html_search_regex('>(.+?)',webpage, 'video url')
+ final_url = self._html_search_regex('>(.+?)', webpage, 'video url')
return final_url
def _real_extract(self, url):
@@ -68,11 +68,11 @@ class TudouIE(InfoExtractor):
final_url = self._url_for_id(part_id, quality)
ext = (final_url.split('?')[0]).split('.')[-1]
part_info = {'id': part_id,
- 'url': final_url,
- 'ext': ext,
- 'title': title,
- 'thumbnail': thumbnail_url,
- }
+ 'url': final_url,
+ 'ext': ext,
+ 'title': title,
+ 'thumbnail': thumbnail_url,
+ }
result.append(part_info)
return result
diff --git a/youtube_dl/extractor/tumblr.py b/youtube_dl/extractor/tumblr.py
index 544369068..e1c2e7b7e 100644
--- a/youtube_dl/extractor/tumblr.py
+++ b/youtube_dl/extractor/tumblr.py
@@ -43,7 +43,7 @@ class TumblrIE(InfoExtractor):
# The only place where you can get a title, it's not complete,
# but searching in other places doesn't work for all videos
video_title = self._html_search_regex(r'(?P.*?)(?: \| Tumblr)?',
- webpage, 'title', flags=re.DOTALL)
+ webpage, 'title', flags=re.DOTALL)
return [{'id': video_id,
'url': video_url,
diff --git a/youtube_dl/extractor/unistra.py b/youtube_dl/extractor/unistra.py
index 474610eec..c6ce3f228 100644
--- a/youtube_dl/extractor/unistra.py
+++ b/youtube_dl/extractor/unistra.py
@@ -2,6 +2,7 @@ import re
from .common import InfoExtractor
+
class UnistraIE(InfoExtractor):
_VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(\d+)'
diff --git a/youtube_dl/extractor/ustream.py b/youtube_dl/extractor/ustream.py
index 7fa2b9e15..9f377832a 100644
--- a/youtube_dl/extractor/ustream.py
+++ b/youtube_dl/extractor/ustream.py
@@ -33,13 +33,13 @@ class UstreamIE(InfoExtractor):
self.report_extraction(video_id)
video_title = self._html_search_regex(r'data-title="(?P.+)"',
- webpage, 'title')
+ webpage, 'title')
uploader = self._html_search_regex(r'data-content-type="channel".*?>(?P.*?)',
- webpage, 'uploader', fatal=False, flags=re.DOTALL)
+ webpage, 'uploader', fatal=False, flags=re.DOTALL)
thumbnail = self._html_search_regex(r'(.*)',
- webpage, 'title').split('/')[0].strip()
+ webpage, 'title').split('/')[0].strip()
info_url = "http://vbox7.com/play/magare.do"
data = compat_urllib_parse.urlencode({'as3': '1', 'vid': video_id})
diff --git a/youtube_dl/extractor/veehd.py b/youtube_dl/extractor/veehd.py
index b1c854a64..1864ff7fe 100644
--- a/youtube_dl/extractor/veehd.py
+++ b/youtube_dl/extractor/veehd.py
@@ -47,11 +47,11 @@ class VeeHDIE(InfoExtractor):
video_url = compat_urlparse.unquote(config['clip']['url'])
title = clean_html(get_element_by_id('videoName', webpage).rpartition('|')[0])
uploader_id = self._html_search_regex(r'(.+?)',
- webpage, 'uploader')
+ webpage, 'uploader')
thumbnail = self._search_regex(r'
(.*?)\d+)(&|#|$)'
IE_NAME = u'videofy.me'
_TEST = {
u'url': u'http://www.videofy.me/thisisvideofyme/1100701',
- u'file': u'1100701.mp4',
+ u'file': u'1100701.mp4',
u'md5': u'c77d700bdc16ae2e9f3c26019bd96143',
u'info_dict': {
u'title': u'This is VideofyMe',
@@ -20,18 +21,18 @@ class VideofyMeIE(InfoExtractor):
u'uploader': u'VideofyMe',
u'uploader_id': u'thisisvideofyme',
},
-
+
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
config = self._download_xml('http://sunshine.videofy.me/?videoId=%s' % video_id,
- video_id)
+ video_id)
video = config.find('video')
sources = video.find('sources')
- url_node = next(node for node in [find_xpath_attr(sources, 'source', 'id', 'HQ %s' % key)
- for key in ['on', 'av', 'off']] if node is not None)
+ url_node = next(node for node in [find_xpath_attr(sources, 'source', 'id', 'HQ %s' % key)
+ for key in ['on', 'av', 'off']] if node is not None)
video_url = url_node.find('url').text
return {'id': video_id,
diff --git a/youtube_dl/extractor/videopremium.py b/youtube_dl/extractor/videopremium.py
index 65463c733..9f2cdb6ef 100644
--- a/youtube_dl/extractor/videopremium.py
+++ b/youtube_dl/extractor/videopremium.py
@@ -35,11 +35,11 @@ class VideoPremiumIE(InfoExtractor):
r'\s*(.+?)\s*<', webpage, u'video title')
return {
- 'id': video_id,
- 'url': "rtmp://e%d.md.iplay.md/play" % random.randint(1, 16),
- 'play_path': "mp4:%s.f4v" % video_id,
- 'page_url': "http://videopremium.tv/" + video_id,
- 'player_url': "http://videopremium.tv/uplayer/uppod.swf",
- 'ext': 'f4v',
- 'title': video_title,
+ 'id': video_id,
+ 'url': "rtmp://e%d.md.iplay.md/play" % random.randint(1, 16),
+ 'play_path': "mp4:%s.f4v" % video_id,
+ 'page_url': "http://videopremium.tv/" + video_id,
+ 'player_url': "http://videopremium.tv/uplayer/uppod.swf",
+ 'ext': 'f4v',
+ 'title': video_title,
}
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py
index c5ee84807..66578c598 100644
--- a/youtube_dl/extractor/vimeo.py
+++ b/youtube_dl/extractor/vimeo.py
@@ -20,6 +20,7 @@ from ..utils import (
class VimeoIE(SubtitlesInfoExtractor):
+
"""Information extractor for vimeo.com."""
# _VALID_URL matches Vimeo URLs
@@ -129,10 +130,10 @@ class VimeoIE(SubtitlesInfoExtractor):
'token': token})
# I didn't manage to use the password with https
if url.startswith('https'):
- pass_url = url.replace('https','http')
+ pass_url = url.replace('https', 'http')
else:
pass_url = url
- password_request = compat_urllib_request.Request(pass_url+'/password', data)
+ password_request = compat_urllib_request.Request(pass_url + '/password', data)
password_request.add_header('Content-Type', 'application/x-www-form-urlencoded')
password_request.add_header('Cookie', 'xsrft=%s' % token)
self._download_webpage(password_request, video_id,
@@ -195,7 +196,7 @@ class VimeoIE(SubtitlesInfoExtractor):
else:
config_re = [r' = {config:({.+?}),assets:', r'(?:[abc])=({.+?});']
config = self._search_regex(config_re, webpage, 'info section',
- flags=re.DOTALL)
+ flags=re.DOTALL)
config = json.loads(config)
except Exception as e:
if re.search('The creator of this video has not given you permission to embed it on this domain.', webpage):
@@ -227,7 +228,8 @@ class VimeoIE(SubtitlesInfoExtractor):
video_description = None
try:
video_description = get_element_by_attribute("itemprop", "description", webpage)
- if video_description: video_description = clean_html(video_description)
+ if video_description:
+ video_description = clean_html(video_description)
except AssertionError as err:
# On some pages like (http://player.vimeo.com/video/54469442) the
# html tags are not closed, python 2.6 cannot handle it
@@ -273,7 +275,7 @@ class VimeoIE(SubtitlesInfoExtractor):
file_info = {}
if video_url is None:
video_url = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=%s&type=moogaloop_local&embed_location=" \
- %(video_id, sig, timestamp, quality, codec_name.upper())
+ % (video_id, sig, timestamp, quality, codec_name.upper())
files[key].append({
'ext': codec_extension,
@@ -332,7 +334,7 @@ class VimeoChannelIE(InfoExtractor):
video_ids = []
for pagenum in itertools.count(1):
webpage = self._download_webpage(
- self._page_url(base_url, pagenum) ,list_id,
+ self._page_url(base_url, pagenum), list_id,
'Downloading page %s' % pagenum)
video_ids.extend(re.findall(r'id="clip_(\d+?)"', webpage))
if re.search(self._MORE_PAGES_INDICATOR, webpage, re.DOTALL) is None:
@@ -348,7 +350,7 @@ class VimeoChannelIE(InfoExtractor):
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
- channel_id = mobj.group('id')
+ channel_id = mobj.group('id')
return self._extract_videos(channel_id, 'http://vimeo.com/channels/%s' % channel_id)
diff --git a/youtube_dl/extractor/vine.py b/youtube_dl/extractor/vine.py
index e14ff91d4..e66a33f81 100644
--- a/youtube_dl/extractor/vine.py
+++ b/youtube_dl/extractor/vine.py
@@ -28,10 +28,10 @@ class VineIE(InfoExtractor):
self.report_extraction(video_id)
video_url = self._html_search_meta('twitter:player:stream', webpage,
- 'video URL')
+ 'video URL')
uploader = self._html_search_regex(r'
(.*?)
',
- webpage, 'uploader', fatal=False, flags=re.DOTALL)
+ webpage, 'uploader', fatal=False, flags=re.DOTALL)
return {
'id': video_id,
diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py
index a293b8875..c9dafc37e 100644
--- a/youtube_dl/extractor/vk.py
+++ b/youtube_dl/extractor/vk.py
@@ -71,7 +71,7 @@ class VKIE(InfoExtractor):
}
request = compat_urllib_request.Request('https://login.vk.com/?act=login',
- compat_urllib_parse.urlencode(login_form).encode('utf-8'))
+ compat_urllib_parse.urlencode(login_form).encode('utf-8'))
login_page = self._download_webpage(request, None, note='Logging in as %s' % username)
if re.search(r'onLoginFailed', login_page):
@@ -89,7 +89,7 @@ class VKIE(InfoExtractor):
if re.search(r'Please log in or <', info_page):
raise ExtractorError('This video is only available for registered users, '
- 'use --username and --password options to provide account credentials.', expected=True)
+ 'use --username and --password options to provide account credentials.', expected=True)
m_yt = re.search(r'src="(http://www.youtube.com/.*?)"', info_page)
if m_yt is not None:
diff --git a/youtube_dl/extractor/vube.py b/youtube_dl/extractor/vube.py
index fbdff471a..b60caf1d9 100644
--- a/youtube_dl/extractor/vube.py
+++ b/youtube_dl/extractor/vube.py
@@ -32,16 +32,16 @@ class VubeIE(InfoExtractor):
video_id = mobj.group('id')
video = self._download_json('http://vube.com/api/v2/video/%s' % video_id,
- video_id, 'Downloading video JSON')
+ video_id, 'Downloading video JSON')
public_id = video['public_id']
formats = [{'url': 'http://video.thestaticvube.com/video/%s/%s.mp4' % (fmt['media_resolution_id'], public_id),
'height': int(fmt['height']),
- 'abr': int(fmt['audio_bitrate']),
- 'vbr': int(fmt['video_bitrate']),
- 'format_id': fmt['media_resolution_id']
- } for fmt in video['mtm'] if fmt['transcoding_status'] == 'processed']
+ 'abr': int(fmt['audio_bitrate']),
+ 'vbr': int(fmt['video_bitrate']),
+ 'format_id': fmt['media_resolution_id']
+ } for fmt in video['mtm'] if fmt['transcoding_status'] == 'processed']
self._sort_formats(formats)
@@ -56,10 +56,10 @@ class VubeIE(InfoExtractor):
duration = video['duration']
view_count = video['raw_view_count']
like_count = video['total_likes']
- dislike_count= video['total_hates']
+ dislike_count = video['total_hates']
comment = self._download_json('http://vube.com/api/video/%s/comment' % video_id,
- video_id, 'Downloading video comment JSON')
+ video_id, 'Downloading video comment JSON')
comment_count = comment['total']
@@ -77,4 +77,4 @@ class VubeIE(InfoExtractor):
'like_count': like_count,
'dislike_count': dislike_count,
'comment_count': comment_count,
- }
\ No newline at end of file
+ }
diff --git a/youtube_dl/extractor/wat.py b/youtube_dl/extractor/wat.py
index 4fab6c6e8..4edf7b610 100644
--- a/youtube_dl/extractor/wat.py
+++ b/youtube_dl/extractor/wat.py
@@ -11,7 +11,7 @@ from ..utils import (
class WatIE(InfoExtractor):
- _VALID_URL=r'http://www\.wat\.tv/.*-(?P.*?)_.*?\.html'
+ _VALID_URL = r'http://www\.wat\.tv/.*-(?P.*?)_.*?\.html'
IE_NAME = 'wat.tv'
_TEST = {
u'url': u'http://www.wat.tv/video/world-war-philadelphia-vost-6bv55_2fjr7_.html',
@@ -23,7 +23,7 @@ class WatIE(InfoExtractor):
},
u'skip': u'Sometimes wat serves the whole file with the --test option',
}
-
+
def download_video_info(self, real_id):
# 'contentv4' is used in the website, but it also returns the related
# videos, we don't need them
@@ -31,7 +31,6 @@ class WatIE(InfoExtractor):
info = json.loads(info)
return info['media']
-
def _real_extract(self, url):
def real_id_for_chapter(chapter):
return chapter['tc_start'].split('-')[0]
diff --git a/youtube_dl/extractor/weibo.py b/youtube_dl/extractor/weibo.py
index fa784ab99..bc6afb085 100644
--- a/youtube_dl/extractor/weibo.py
+++ b/youtube_dl/extractor/weibo.py
@@ -5,7 +5,9 @@ import json
from .common import InfoExtractor
+
class WeiboIE(InfoExtractor):
+
"""
The videos in Weibo come from different sites, this IE just finds the link
to the external video and returns it.
@@ -37,7 +39,7 @@ class WeiboIE(InfoExtractor):
info = json.loads(info_page)
videos_urls = map(lambda v: v['play_page_url'], info['result']['data'])
- #Prefer sina video since they have thumbnails
+ # Prefer sina video since they have thumbnails
videos_urls = sorted(videos_urls, key=lambda u: u'video.sina.com' in u)
player_url = videos_urls[-1]
m_sina = re.match(r'https?://video.sina.com.cn/v/b/(\d+)-\d+.html', player_url)
@@ -46,4 +48,3 @@ class WeiboIE(InfoExtractor):
sina_id = m_sina.group(1)
player_url = 'http://you.video.sina.com.cn/swf/quotePlayer.swf?vid=%s' % sina_id
return self.url_result(player_url)
-
diff --git a/youtube_dl/extractor/worldstarhiphop.py b/youtube_dl/extractor/worldstarhiphop.py
index 3237596a3..4e0f45afd 100644
--- a/youtube_dl/extractor/worldstarhiphop.py
+++ b/youtube_dl/extractor/worldstarhiphop.py
@@ -14,7 +14,6 @@ class WorldStarHipHopIE(InfoExtractor):
}
}
-
def _real_extract(self, url):
m = re.match(self._VALID_URL, url)
video_id = m.group('id')
@@ -22,14 +21,14 @@ class WorldStarHipHopIE(InfoExtractor):
webpage_src = self._download_webpage(url, video_id)
m_vevo_id = re.search(r'videoId=(.*?)&?',
- webpage_src)
-
+ webpage_src)
+
if m_vevo_id is not None:
self.to_screen(u'Vevo video detected:')
return self.url_result('vevo:%s' % m_vevo_id.group(1), ie='Vevo')
video_url = self._search_regex(r'so\.addVariable\("file","(.*?)"\)',
- webpage_src, u'video URL')
+ webpage_src, u'video URL')
if 'youtube' in video_url:
self.to_screen(u'Youtube video detected:')
@@ -41,11 +40,11 @@ class WorldStarHipHopIE(InfoExtractor):
ext = 'flv'
video_title = self._html_search_regex(r"(.*)",
- webpage_src, u'title')
+ webpage_src, u'title')
# Getting thumbnail and if not thumbnail sets correct title for WSHH candy video.
thumbnail = self._html_search_regex(r'rel="image_src" href="(.*)" />',
- webpage_src, u'thumbnail', fatal=False)
+ webpage_src, u'thumbnail', fatal=False)
if not thumbnail:
_title = r"""candytitles.*>(.*)"""
@@ -54,10 +53,10 @@ class WorldStarHipHopIE(InfoExtractor):
video_title = mobj.group(1)
results = [{
- 'id': video_id,
- 'url' : video_url,
- 'title' : video_title,
- 'thumbnail' : thumbnail,
- 'ext' : ext,
- }]
+ 'id': video_id,
+ 'url': video_url,
+ 'title': video_title,
+ 'thumbnail': thumbnail,
+ 'ext': ext,
+ }]
return results
diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py
index a75e1380d..ea5fa5e2d 100644
--- a/youtube_dl/extractor/xhamster.py
+++ b/youtube_dl/extractor/xhamster.py
@@ -13,6 +13,7 @@ from ..utils import (
class XHamsterIE(InfoExtractor):
+
"""Information Extractor for xHamster"""
_VALID_URL = r'http://(?:www\.)?xhamster\.com/movies/(?P[0-9]+)/(?P.+?)\.html(?:\?.*)?'
_TESTS = [
@@ -44,7 +45,7 @@ class XHamsterIE(InfoExtractor):
}
]
- def _real_extract(self,url):
+ def _real_extract(self, url):
def extract_video_url(webpage):
mp4 = re.search(r'
',
- webpage, 'duration', fatal=False))
+ webpage, 'duration', fatal=False))
view_count = self._html_search_regex(r'Views: ([^<]+) ', webpage, 'view count', fatal=False)
if view_count:
diff --git a/youtube_dl/extractor/xnxx.py b/youtube_dl/extractor/xnxx.py
index 1177a4b14..0d88c3044 100644
--- a/youtube_dl/extractor/xnxx.py
+++ b/youtube_dl/extractor/xnxx.py
@@ -33,14 +33,14 @@ class XNXXIE(InfoExtractor):
webpage = self._download_webpage(url, video_id)
video_url = self._search_regex(self.VIDEO_URL_RE,
- webpage, u'video URL')
+ webpage, u'video URL')
video_url = compat_urllib_parse.unquote(video_url)
video_title = self._html_search_regex(self.VIDEO_TITLE_RE,
- webpage, u'title')
+ webpage, u'title')
video_thumbnail = self._search_regex(self.VIDEO_THUMB_RE,
- webpage, u'thumbnail', fatal=False)
+ webpage, u'thumbnail', fatal=False)
return [{
'id': video_id,
diff --git a/youtube_dl/extractor/xtube.py b/youtube_dl/extractor/xtube.py
index 982619922..c23d9f686 100644
--- a/youtube_dl/extractor/xtube.py
+++ b/youtube_dl/extractor/xtube.py
@@ -9,6 +9,7 @@ from ..utils import (
compat_urllib_request,
)
+
class XTubeIE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:www\.)?(?P