[liveleak] removed global video counter

This commit is contained in:
aeph6Ee0 2015-09-15 16:33:57 +02:00
parent 4ac4c76ead
commit 4c24e389dc

View File

@ -53,14 +53,12 @@ class LiveLeakIE(InfoExtractor):
} }
}] }]
video_count = 0 def _video_count(self, entries):
count = len(entries)
def _video_count(self): if count == 0:
self.video_count += 1
if self.video_count == 1:
return '' return ''
else: else:
return '-' + str(self.video_count - 1) return '-' + str(count)
# Removing '.h264_*.mp4' gives the raw video, which is essentially # Removing '.h264_*.mp4' gives the raw video, which is essentially
# the same video without the LiveLeak logo at the top (see # the same video without the LiveLeak logo at the top (see
@ -110,7 +108,7 @@ class LiveLeakIE(InfoExtractor):
self._sort_formats(formats) self._sort_formats(formats)
entries.append({ entries.append({
'id': page_id, 'id': page_id + self._video_count(entries),
'title': video_title, 'title': video_title,
'description': video_description, 'description': video_description,
'uploader': video_uploader, 'uploader': video_uploader,
@ -136,7 +134,7 @@ class LiveLeakIE(InfoExtractor):
'preference': 1, 'preference': 1,
}) })
entries.append({ entries.append({
'id': page_id + self._video_count(), 'id': page_id + self._video_count(entries),
'title': video_title, 'title': video_title,
'description': video_description, 'description': video_description,
'uploader': video_uploader, 'uploader': video_uploader,
@ -163,7 +161,7 @@ class LiveLeakIE(InfoExtractor):
for embed_url in embed_urls: for embed_url in embed_urls:
entries.append({ entries.append({
'_type': 'url_transparent', '_type': 'url_transparent',
'id': page_id + self._video_count(), 'id': page_id + self._video_count(entries),
'url': embed_url, 'url': embed_url,
'title': video_title, 'title': video_title,
'description': video_description, 'description': video_description,