mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-03 21:03:22 +08:00
Added _remove_duplicate_formats_by_id
This commit is contained in:
parent
451d7917fd
commit
a0b875578c
@ -1025,6 +1025,16 @@ class InfoExtractor(object):
|
|||||||
unique_formats.append(f)
|
unique_formats.append(f)
|
||||||
formats[:] = unique_formats
|
formats[:] = unique_formats
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _remove_duplicate_formats_by_id(formats):
|
||||||
|
format_ids = set()
|
||||||
|
unique_formats = []
|
||||||
|
for f in formats:
|
||||||
|
if f['format_id'] not in format_ids:
|
||||||
|
format_ids.add(f['format_id'])
|
||||||
|
unique_formats.append(f)
|
||||||
|
formats[:] = unique_formats
|
||||||
|
|
||||||
def _is_valid_url(self, url, video_id, item='video', headers={}):
|
def _is_valid_url(self, url, video_id, item='video', headers={}):
|
||||||
url = self._proto_relative_url(url, scheme='http:')
|
url = self._proto_relative_url(url, scheme='http:')
|
||||||
# For now assume non HTTP(S) URLs always valid
|
# For now assume non HTTP(S) URLs always valid
|
||||||
|
Loading…
Reference in New Issue
Block a user