Cleanup
This commit is contained in:
parent
63c3a458cb
commit
52f319ddd0
@ -18,12 +18,7 @@ class MyTaratataIE(InfoExtractor):
|
|||||||
'title': u'TARATATA N°519 - Shaka Ponk / Camille et Julie Berthollet "Smells Like Teen Spirit" (Nirvana)',
|
'title': u'TARATATA N°519 - Shaka Ponk / Camille et Julie Berthollet "Smells Like Teen Spirit" (Nirvana)',
|
||||||
'uploader': 'Taratata',
|
'uploader': 'Taratata',
|
||||||
'description': 'Shaka Ponk / Camille et Julie Berthollet "Smells Like Teen Spirit" (Nirvana)',
|
'description': 'Shaka Ponk / Camille et Julie Berthollet "Smells Like Teen Spirit" (Nirvana)',
|
||||||
# 'thumbnail': r're:^https?://.*\.jpg$',
|
'thumbnail': 'http://static.mytaratata.com/content/image/5a2562a1a5ee5.jpeg',
|
||||||
# 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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +36,8 @@ class MyTaratataIE(InfoExtractor):
|
|||||||
r'/mytaratata/Taratata[^"]+\.mp4)"'
|
r'/mytaratata/Taratata[^"]+\.mp4)"'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# The first videos are the live videos, coming in 2 formats. The next videos are
|
||||||
|
# bonuses, multi-cams... that we won't download.
|
||||||
last_vid = None
|
last_vid = None
|
||||||
for url in video_source_re.findall(webpage):
|
for url in video_source_re.findall(webpage):
|
||||||
info_m = re.match(r'.*/(?P<vid>[0-9]+)-[a-f0-9]+-(?P<w>[0-9]+)x(?P<h>[0-9]+)\.mp4', url)
|
info_m = re.match(r'.*/(?P<vid>[0-9]+)-[a-f0-9]+-(?P<w>[0-9]+)x(?P<h>[0-9]+)\.mp4', url)
|
||||||
@ -49,9 +46,12 @@ class MyTaratataIE(InfoExtractor):
|
|||||||
vid = info_m.group('vid')
|
vid = info_m.group('vid')
|
||||||
w = info_m.group('w')
|
w = info_m.group('w')
|
||||||
h = info_m.group('h')
|
h = info_m.group('h')
|
||||||
|
|
||||||
if last_vid is None:
|
if last_vid is None:
|
||||||
last_vid = vid
|
last_vid = vid
|
||||||
|
|
||||||
if vid != last_vid:
|
if vid != last_vid:
|
||||||
|
# We found a new video, not another format of the same. Stops here.
|
||||||
break
|
break
|
||||||
|
|
||||||
formats.append({
|
formats.append({
|
||||||
@ -66,10 +66,7 @@ class MyTaratataIE(InfoExtractor):
|
|||||||
'id': last_vid,
|
'id': last_vid,
|
||||||
'title': '%s - %s' % (title, description),
|
'title': '%s - %s' % (title, description),
|
||||||
'description': description,
|
'description': description,
|
||||||
# TODO Improve the filename, id, title.
|
|
||||||
'uploader': "Taratata",
|
'uploader': "Taratata",
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'thumbnails': [
|
'thumbnail': self._og_search_thumbnail(webpage),
|
||||||
{'url': self._og_search_thumbnail(webpage)},
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user