Skip to content

Commit

Permalink
[iq.com] Add extractors (yt-dlp#2354)
Browse files Browse the repository at this point in the history
Closes yt-dlp#704
Authored by: MinePlayersPE
  • Loading branch information
MinePlayersPE authored Jan 19, 2022
1 parent 64f3654 commit 4267643
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 5 deletions.
4 changes: 3 additions & 1 deletion yt_dlp/YoutubeDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -2751,7 +2751,9 @@ def dl(self, name, info, subtitle=False, test=False):
if not test:
for ph in self._progress_hooks:
fd.add_progress_hook(ph)
urls = '", "'.join([f['url'] for f in info.get('requested_formats', [])] or [info['url']])
urls = '", "'.join(
(f['url'].split(',')[0] + ',<data>' if f['url'].startswith('data:') else f['url'])
for f in info.get('requested_formats', []) or [info])
self.write_debug('Invoking downloader on "%s"' % urls)

# Note: Ideally info should be a deep-copied so that hooks cannot modify it.
Expand Down
5 changes: 3 additions & 2 deletions yt_dlp/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
determine_ext,
determine_protocol,
dict_get,
encode_data_uri,
error_to_compat_str,
extract_attributes,
ExtractorError,
Expand Down Expand Up @@ -2106,7 +2107,7 @@ def _extract_m3u8_formats_and_subtitles(
headers=headers, query=query, video_id=video_id)

def _parse_m3u8_formats_and_subtitles(
self, m3u8_doc, m3u8_url, ext=None, entry_protocol='m3u8_native',
self, m3u8_doc, m3u8_url=None, ext=None, entry_protocol='m3u8_native',
preference=None, quality=None, m3u8_id=None, live=False, note=None,
errnote=None, fatal=True, data=None, headers={}, query={},
video_id=None):
Expand Down Expand Up @@ -2156,7 +2157,7 @@ def _extract_m3u8_playlist_indices(*args, **kwargs):
formats = [{
'format_id': join_nonempty(m3u8_id, idx),
'format_index': idx,
'url': m3u8_url,
'url': m3u8_url or encode_data_uri(m3u8_doc.encode('utf-8'), 'application/x-mpegurl'),
'ext': ext,
'protocol': entry_protocol,
'preference': preference,
Expand Down
6 changes: 5 additions & 1 deletion yt_dlp/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,11 @@
IPrimaIE,
IPrimaCNNIE
)
from .iqiyi import IqiyiIE
from .iqiyi import (
IqiyiIE,
IqIE,
IqAlbumIE
)
from .ir90tv import Ir90TvIE
from .itv import (
ITVIE,
Expand Down
Loading

0 comments on commit 4267643

Please sign in to comment.