before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'info_dict': {
'id': '5c271b40b13fd613090034fd',
'ext': 'mp4',
'title': 'That Time Disney Remade Beauty and the Beast',
'description': 'Note: this video was originally posted on YouTube with the sponsor read included. We weren’t able to remove ... | Could u remove the `'usenetrc': True`. At the time of the original PR, I didn't know this, but this should be actually be added to `test/local_parameters.json` instead | 'info_dict': {
'id': '5c271b40b13fd613090034fd',
'ext': 'mp4',
'title': 'That Time Disney Remade Beauty and the Beast',
'description': 'Note: this video was originally posted on YouTube with the sponsor read included. We weren’t able to remove ... | @@ -169,14 +167,25 @@ class NebulaIE(NebulaBaseIE):
'channel_id': 'lindsayellis',
'uploader': 'Lindsay Ellis',
'uploader_id': 'lindsayellis',
+
+ 'timestamp': 1533009600,
+ 'uploader_url': 'https://nebula.app/lindsayellis',
+ ... | yt_dlp/extractor/nebula.py | 26 | Python | 0.571 | suggestion | 167 | 51 | 51 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
'id': 'myshows',
},
'params': {
'usenetrc': True,
},
},
]
CHANNEL_URL = 'https://content.watchnebula.com/library/video/?page_size=100'
def _generate_playlist_entries(self):
next_url = self.CHANNEL_URL
page_num = 1
... | ```suggestion
return self.playlist_result(self._generate_playlist_entries(), 'myshows')
``` | yield self._build_video_info(episode)
next_url = channel['next']
page_num += 1
def _real_extract(self, url):
return self.playlist_result(self._generate_playlist_entries(), 'myshows')
class NebulaChannelIE(NebulaBaseIE):
IE_NAME = 'nebula:channel'
_VALID_URL... | @@ -230,9 +259,45 @@ def _real_extract(self, url):
return self._build_video_info(video)
-class NebulaCollectionIE(NebulaBaseIE):
- IE_NAME = 'nebula:collection'
- _VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/(?!videos/)(?P<id>[-\w]+)'
+class NebulaSubscriptionsIE(NebulaBaseIE):
... | yt_dlp/extractor/nebula.py | 26 | Python | 0.714 | suggestion | 101 | 51 | 51 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
},
]
CHANNEL_URL = 'https://content.watchnebula.com/library/video/?page_size=100'
def _generate_playlist_entries(self):
next_url = self.CHANNEL_URL
page_num = 1
while next_url:
channel = self._call_nebula_api(next_url, 'subscriptions', auth_type='bearer',
... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/(?!myshows|videos/)(?P<id>[-\w]+)'
``` | return self.playlist_result(self._generate_playlist_entries(), 'myshows')
class NebulaChannelIE(NebulaBaseIE):
IE_NAME = 'nebula:channel'
_VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/(?!myshows|videos/)(?P<id>[-\w]+)'
_TESTS = [
{
'url': 'https://nebula.ap... | @@ -230,9 +259,45 @@ def _real_extract(self, url):
return self._build_video_info(video)
-class NebulaCollectionIE(NebulaBaseIE):
- IE_NAME = 'nebula:collection'
- _VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/(?!videos/)(?P<id>[-\w]+)'
+class NebulaSubscriptionsIE(NebulaBaseIE):
... | yt_dlp/extractor/nebula.py | 26 | Python | 0.714 | suggestion | 125 | 51 | 51 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
)
class NebulaChannelIE(NebulaBaseIE):
IE_NAME = 'nebula:channel'
_VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/(?!myshows)(?!videos/)(?P<id>[-\w]+)'
_TESTS = [
{
'url': 'https://nebula.app/tom-scott-presents-money',
'info_dict': {
... | wasn't the mincount set high to test pagination? What happened? | 'description': 'Enjoy these hottest of takes on Disney, Transformers, and Musicals.',
},
'playlist_mincount': 100,
},
]
def _generate_playlist_entries(self, collection_id, channel):
episodes = channel['episodes']['results']
for page_num in itertoo... | @@ -252,7 +317,7 @@ class NebulaCollectionIE(NebulaBaseIE):
'title': 'Lindsay Ellis',
'description': 'Enjoy these hottest of takes on Disney, Transformers, and Musicals.',
},
- 'playlist_mincount': 100,
+ 'playlist_mincount': 10, | yt_dlp/extractor/nebula.py | 26 | Python | 0.214 | question | 63 | 51 | 31 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
def _real_extract(self, url):
slug = self._match_id(url)
video = self._fetch_video_metadata(slug)
return self._build_video_info(video)
class NebulaSubscriptionsIE(NebulaBaseIE):
IE_NAME = 'nebula:subscriptions'
_VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/mysh... | ```suggestion
def _generate_playlist_entries(self):
next_url = 'https://content.watchnebula.com/library/video/?page_size=100'
``` | 'playlist_mincount': 1,
'info_dict': {
'id': 'myshows',
},
},
]
def _generate_playlist_entries(self):
next_url = 'https://content.watchnebula.com/library/video/?page_size=100'
page_num = 1
while next_url:
channel = ... | @@ -230,9 +259,45 @@ def _real_extract(self, url):
return self._build_video_info(video)
-class NebulaCollectionIE(NebulaBaseIE):
- IE_NAME = 'nebula:collection'
- _VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/(?!videos/)(?P<id>[-\w]+)'
+class NebulaSubscriptionsIE(NebulaBaseIE):
... | yt_dlp/extractor/nebula.py | 26 | Python | 0.714 | suggestion | 144 | 51 | 51 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
return self._build_video_info(video)
class NebulaSubscriptionsIE(NebulaBaseIE):
IE_NAME = 'nebula:subscriptions'
_VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/myshows'
_TESTS = [
{
'url': 'https://nebula.app/myshows',
'playlist_mincount': 1,
... | Keep consistency. It is called `myshows` below
```suggestion
channel = self._call_nebula_api(next_url, 'myshows', auth_type='bearer',
``` | },
},
]
def _generate_playlist_entries(self):
next_url = 'https://content.watchnebula.com/library/video/?page_size=100'
page_num = 1
while next_url:
channel = self._call_nebula_api(next_url, 'myshows', auth_type='bearer',
... | @@ -230,9 +259,45 @@ def _real_extract(self, url):
return self._build_video_info(video)
-class NebulaCollectionIE(NebulaBaseIE):
- IE_NAME = 'nebula:collection'
- _VALID_URL = r'https?://(?:www\.)?(?:watchnebula\.com|nebula\.app)/(?!videos/)(?P<id>[-\w]+)'
+class NebulaSubscriptionsIE(NebulaBaseIE):
... | yt_dlp/extractor/nebula.py | 26 | Python | 0.857 | security | 152 | 51 | 51 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
]
check_results = (not re.search(feature, manifest) for feature in UNSUPPORTED_FEATURES)
return all(check_results)
def _make_cmd(self, tmpfilename, info_dict):
cmd = [self.exe, '-c',
'--console-log-level=warn', '--summary-interval=0', '--download-result=hide',
... | would it be a good idea to enable auth here? (`--rpc-secret` maybe?) |
@staticmethod
def _aria2c_filename(fn):
return fn if os.path.isabs(fn) else f'.{os.path.sep}{fn}'
def _call_downloader(self, tmpfilename, info_dict):
if 'no-external-downloader-progress' not in self.params.get('compat_opts', []):
info_dict['__rpc'] = {
'port': f... | @@ -272,6 +280,9 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += self._bool_option('--show-console-readout', 'noprogress', 'false', 'true', '=')
cmd += self._configuration_args()
+ if info_dict.get('__rpc_port'):
+ cmd += ['--enable-rpc', f'--rpc-listen-port={info_dict["__rp... | yt_dlp/downloader/external.py | 26 | Python | 0.357 | security | 68 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | Lesmiscore |
cmd += ['--out', f'.{os.path.sep}{os.path.basename(tmpfilename)}']
cmd += ['--auto-file-renaming=false']
if 'fragments' in info_dict:
cmd += ['--file-allocation=none', '--uri-selector=inorder']
url_list_file = '%s.frag.urls' % tmpfilename
url_list = []
... | ```suggestion
info_dict['__rpc_port'] = find_available_port() or 19190
info_dict['__rpc_secret'] = str(uuid.uuid4())
```
* why's _ENABLE_PROGRESS needed?
* why the pop and copy?
* Why import uuid locally? | # See: https://github.com/yt-dlp/yt-dlp/issues/276
# https://github.com/ytdl-org/youtube-dl/issues/20312
# https://github.com/aria2/aria2/issues/1373
dn = os.path.dirname(tmpfilename)
if dn:
cmd += ['--dir', self._aria2c_filename(dn) + os.path.sep]
if 'fragmen... | @@ -302,6 +316,137 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict.pop('__rpc_port', None)
+ info_dict.pop('__rpc_secret', None)
+ if self._ENABLE_PROGRESS:
+ ... | yt_dlp/downloader/external.py | 26 | Python | 0.786 | security | 226 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'Content-Length': f'{len(d)}',
'Ytdl-request-proxy': '__noproxy__',
},
data=d)
with self.ydl.urlopen(request) as r:
resp = json.load(r)
# failing at this assertion means that the RPC server went wrong
... | why use tempfile? Cant `subprocess.PIPE` be used? | status = {
'filename': info_dict.get('_filename'),
'status': 'downloading',
'elapsed': 0,
'downloaded_bytes': 0,
'fragment_count': frag_count if fragmented else None,
'fragment_index': 0 if fragmented else None,
}
self._hook... | @@ -302,6 +316,137 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict.pop('__rpc_port', None)
+ info_dict.pop('__rpc_secret', None)
+ if self._ENABLE_PROGRESS:
+ ... | yt_dlp/downloader/external.py | 26 | Python | 0.286 | question | 49 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'eta': try_get(0, lambda x: (tl - cl) / ds),
'total_bytes': tl,
})
continue
# fragmented
total_bytes = sum(map(int, traverse_obj([aktiva, completed], (..., ..., 'totalLength')... | why is this in `finally`? especially sleep and poll | class HttpieFD(ExternalFD):
AVAILABLE_OPT = '--version'
EXE_NAME = 'http'
def _make_cmd(self, tmpfilename, info_dict):
cmd = ['http', '--download', '--output', tmpfilename, info_dict['url']]
if info_dict.get('http_headers') is not None:
for key, val in info_dict['http_headers']... | @@ -302,6 +316,137 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict.pop('__rpc_port', None)
+ info_dict.pop('__rpc_secret', None)
+ if self._ENABLE_PROGRESS:
+ ... | yt_dlp/downloader/external.py | 26 | Python | 0.357 | question | 51 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
cmd += ['--auto-file-renaming=false']
if 'fragments' in info_dict:
cmd += ['--file-allocation=none', '--uri-selector=inorder']
url_list_file = '%s.frag.urls' % tmpfilename
url_list = []
for frag_index, fragment in enumerate(info_dict['fragments']):
... | ```suggestion
# note: there's no need to be UUID (it can even a numeric value), but that's easier and long enough not to make duplicate one
``` | if dn:
cmd += ['--dir', self._aria2c_filename(dn) + os.path.sep]
if 'fragments' not in info_dict:
cmd += ['--out', self._aria2c_filename(os.path.basename(tmpfilename))]
cmd += ['--auto-file-renaming=false']
if 'fragments' in info_dict:
cmd += ['--file... | @@ -304,6 +319,130 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict['__rpc_port'] = find_available_port() or 19190
+ info_dict['__rpc_secret'] = str(uuid.uuid4())
+ ... | yt_dlp/downloader/external.py | 26 | Python | 0.714 | refactor | 153 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | Lesmiscore |
# https://github.com/aria2/aria2/issues/1373
dn = os.path.dirname(tmpfilename)
if dn:
cmd += ['--dir', self._aria2c_filename(dn) + os.path.sep]
if 'fragments' not in info_dict:
cmd += ['--out', self._aria2c_filename(os.path.basename(tmpfilename))]
cmd += [... | we should put this behind a compat option, just in case | # We work around this issue by adding a "./" to the beginning of the
# filename and relative path, and adding a "/" at the end of the path.
# See: https://github.com/yt-dlp/yt-dlp/issues/276
# https://github.com/ytdl-org/youtube-dl/issues/20312
# https://github.com/aria2/aria2/is... | @@ -304,6 +319,130 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict['__rpc_port'] = find_available_port() or 19190
+ info_dict['__rpc_secret'] = str(uuid.uuid4()) | yt_dlp/downloader/external.py | 26 | Python | 0.286 | suggestion | 55 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
while retval is None:
try:
# https://aria2.github.io/manual/en/html/libaria2.html#c.DOWNLOAD_WAITING
# https://aria2.github.io/manual/en/html/aria2c.html#aria2.tellActive
# use tellActive as we won't know the GID without reading st... | this branch is almost same as frag_count=1 and not really needed | total = frag_count * get_stat('totalLength', active, completed, average=True)
if total < downloaded:
total = None
status.update({
'downloaded_bytes': int(downloaded),
'speed': speed,
'total_b... | @@ -304,6 +319,130 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict['__rpc_port'] = find_available_port() or 19190
+ info_dict['__rpc_secret'] = str(uuid.uuid4())
+ ... | yt_dlp/downloader/external.py | 26 | Python | 0.214 | suggestion | 64 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
if completed or aktiva:
total_bytes = total_bytes * nr_frags / (len(completed) + len(aktiva))
total_completed = sum(map(int, traverse_obj(completed, (..., 'totalLength'), default=[])))
dled_aktiva = sum(map(int, traverse_obj(aktiva, (..... | real_download calls `finished` causing this to be triggered twice |
def _make_cmd(self, tmpfilename, info_dict):
cmd = ['http', '--download', '--output', tmpfilename, info_dict['url']]
if info_dict.get('http_headers') is not None:
for key, val in info_dict['http_headers'].items():
cmd += [f'{key}:{val}']
return cmd
class FFmpe... | @@ -304,6 +319,130 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict['__rpc_port'] = find_available_port() or 19190
+ info_dict['__rpc_secret'] = str(uuid.uuid4())
+ ... | yt_dlp/downloader/external.py | 26 | Python | 0.357 | suggestion | 65 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'fragment_count': nr_frags,
'fragment_index': 0,
})
self._hook_progress(status, info_dict)
with TemporaryFile() as so, TemporaryFile() as se, \
Popen(cmd, stdout=so.fileno(), stderr=se.fileno() if capture_stderr else None) as p:
# mak... | hook should trigger in this case too | # or the connection stalls infinitely
time.sleep(0.2)
retval = p.poll()
while retval is None:
# We don't use tellStatus as we won't know the GID without reading stdout
# Ref: https://aria2.github.io/manual/en/html/aria2c.html#aria2.tellActi... | @@ -304,6 +319,130 @@ def _make_cmd(self, tmpfilename, info_dict):
cmd += ['--', info_dict['url']]
return cmd
+ def _call_downloader(self, tmpfilename, info_dict):
+ info_dict['__rpc_port'] = find_available_port() or 19190
+ info_dict['__rpc_secret'] = str(uuid.uuid4())
+ ... | yt_dlp/downloader/external.py | 26 | Python | 0.143 | suggestion | 36 | 51 | 51 | false | [downloader/aria2c] Native progress for aria2c via RPC | 3,724 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
from .common import InfoExtractor
class InaIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|m)\.)?ina\.fr/.*(?:video|audio)/(?P<id>[\w\d_]+).*'
_TESTS = [{
'url': 'https://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.html',
'md5': 'c5a09e5cb5604ed10709f06e7a3... | ```suggestion
_VALID_URL = r'https?://(?:(?:www|m)\.)?ina\.fr/(?:[^/]+/)?(?:video|audio)/(?P<id>\w+)'
``` | from .common import InfoExtractor
from ..utils import unified_strdate
class InaIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|m)\.)?ina\.fr/(?:[^/]+/)?(?:video|audio)/(?P<id>\w+)'
_TESTS = [{
'url': 'https://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.html',
... | @@ -1,23 +1,18 @@
from .common import InfoExtractor
-from ..utils import (
- determine_ext,
- int_or_none,
- strip_or_none,
- xpath_attr,
- xpath_text,
-)
class InaIE(InfoExtractor):
- _VALID_URL = r'https?://(?:(?:www|m)\.)?ina\.fr/(?:video|audio)/(?P<id>[A-Z0-9_]+)'
+ _VALID_URL = r'https?:... | yt_dlp/extractor/ina.py | 5 | Python | 0.714 | suggestion | 111 | 30 | 30 | false | [ina] Update extractor | 3,807 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
}, {
'url': 'https://www.ina.fr/video/P16173408-video.html',
'only_matching': True,
}, {
'url': 'http://m.ina.fr/video/I12055569',
'only_matching': True,
}, {
'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
'md5': '4b82... | ```suggestion
api_url = self._html_search_regex(
r'asset-details-url\s*=\s*["\'](?P<api_url>[^"\']+)',
webpage, 'API URL').replace(video_id, f'{video_id}.json')
```
Are you sure u need `_html_search_regex` and not just `_search_regex`? | 'only_matching': True,
}, {
'url': 'https://www.ina.fr/video/P16173408-video.html',
'only_matching': True,
}, {
'url': 'http://m.ina.fr/video/I12055569',
'only_matching': True,
}, {
'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-elect... | @@ -31,53 +26,36 @@ class InaIE(InfoExtractor):
}, {
'url': 'http://m.ina.fr/video/I12055569',
'only_matching': True,
+ }, {
+ 'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
+ 'md5': '4b8284a9a3a184fdc7e744225b8251e7',
+ 'info_dict... | yt_dlp/extractor/ina.py | 26 | Python | 0.857 | question | 272 | 40 | 42 | false | [ina] Update extractor | 3,807 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
'md5': '4b8284a9a3a184fdc7e744225b8251e7',
'info_dict': {
'id': 'CPB8205116303',
'ext': 'mp4',
'title': 'Les jeux électroniques',
'description': 'md5:e09f7683d... | ```suggestion
'ext': {'video': 'mp4', 'audio': 'mp3'}.get(api_response.get('type')),
``` | }, {
'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
'md5': '4b8284a9a3a184fdc7e744225b8251e7',
'info_dict': {
'id': 'CPB8205116303',
'ext': 'mp4',
'title': 'Les jeux électroniques',
'description': 'md5:... | @@ -31,53 +26,36 @@ class InaIE(InfoExtractor):
}, {
'url': 'http://m.ina.fr/video/I12055569',
'only_matching': True,
+ }, {
+ 'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
+ 'md5': '4b8284a9a3a184fdc7e744225b8251e7',
+ 'info_dict... | yt_dlp/extractor/ina.py | 26 | Python | 0.857 | suggestion | 102 | 33 | 35 | false | [ina] Update extractor | 3,807 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
'id': 'CPB8205116303',
'ext': 'mp4',
'title': 'Les jeux électroniques',
'description': 'md5:e09f7683dad1cc60b74950490127d233',
'date': 're:1982-12-04T.*',
'duration': 657,
'thumbnail': 'https://cdn-hub.ina.fr/notice/690x517/203/CPB82051... | There is no field `date`. Convert it into `timestamp` | 'info_dict': {
'id': 'CPB8205116303',
'ext': 'mp4',
'title': 'Les jeux électroniques',
'description': 'md5:e09f7683dad1cc60b74950490127d233',
'upload_date': '19821204',
'duration': 657,
'thumbnail': 'https://cdn-hub.ina.fr/notic... | @@ -31,53 +26,36 @@ class InaIE(InfoExtractor):
}, {
'url': 'http://m.ina.fr/video/I12055569',
'only_matching': True,
+ }, {
+ 'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
+ 'md5': '4b8284a9a3a184fdc7e744225b8251e7',
+ 'info_dict... | yt_dlp/extractor/ina.py | 26 | Python | 0.357 | suggestion | 53 | 30 | 32 | false | [ina] Update extractor | 3,807 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
'info_dict': {
'id': 'CPB8205116303',
'ext': 'mp4',
'title': 'Les jeux électroniques',
'description': 'md5:e09f7683dad1cc60b74950490127d233',
'upload_date': '19821204',
'duration': 657,
'thumbnail': 'https://cdn-hub.ina.fr/notic... | ```suggestion
'title': api_response.get('title'),
``` | 'info_dict': {
'id': 'CPB8205116303',
'ext': 'mp4',
'title': 'Les jeux électroniques',
'description': 'md5:e09f7683dad1cc60b74950490127d233',
'upload_date': '19821204',
'duration': 657,
'thumbnail': 'https://cdn-hub.ina.fr/notic... | @@ -31,53 +27,37 @@ class InaIE(InfoExtractor):
}, {
'url': 'http://m.ina.fr/video/I12055569',
'only_matching': True,
+ }, {
+ 'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
+ 'md5': '4b8284a9a3a184fdc7e744225b8251e7',
+ 'info_dict... | yt_dlp/extractor/ina.py | 26 | Python | 0.571 | suggestion | 67 | 32 | 32 | false | [ina] Update extractor | 3,807 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
'url': 'https://www.facebook.com/onlycleverentertainment/videos/1947995502095005/',
'only_matching': True,
}, {
# data.video
'url': 'https://www.facebook.com/WatchESLOne/videos/359649331226507/',
'info_dict': {
'id': '359649331226507',
'ext': 'mp4',
... | For this url should we be matching the `id` query param as the id instead of `story_fbid`?
I think these need to be actual tests instead of `only_matching` | 'title': 'Pence MUST GO!',
'description': 'Vickie Gentry shared a memory.',
'timestamp': 1511548260,
'upload_date': '20171124',
'uploader': 'Vickie Gentry',
'uploader_id': 'pfbid0FuZhHCeWDAxWxEbr3yKPFaRstXvRxgsp9uCPG6GjD4J2AitB35NUAuJ4Q75KcjiDl',
... | @@ -204,6 +204,12 @@ class FacebookIE(InfoExtractor):
'params': {
'skip_download': True,
},
+ }, {
+ 'url': 'https://www.facebook.com/attn/posts/pfbid0j1Czf2gGDVqeQ8KiMLFm3pWN8GxsQmeRrVhimWDzMuKQoR8r4b1knNsejELmUgyhl',
+ 'only_matching': True,
+ }, {
+ 'url': 'h... | yt_dlp/extractor/facebook.py | 26 | Python | 0.571 | suggestion | 158 | 51 | 51 | false | [facebook] Update extractor for new URL | 3,824 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Wikidepia |
from .common import InfoExtractor
from ..utils import (
traverse_obj,
ExtractorError,
# GeoRestrictedError,
)
class NetverseBaseIE(InfoExtractor):
def get_required_json(self, url, data=None):
match = self._match_valid_url(url).groupdict()
display_id, sites_type = match['display_id'], m... | ```suggestion
display_id, sites_type = self._match_valid_url(url).group('display_id', 'type')
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 12 | Python | 0.857 | suggestion | 107 | 37 | 37 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
traverse_obj,
ExtractorError,
# GeoRestrictedError,
)
class NetverseBaseIE(InfoExtractor):
def get_required_json(self, url, data=None):
match = self._match_valid_url(url).groupdict()
display_id, sites_type = match['display_id'], m... | ```suggestion
json_data = self._download_json(
f'https://api.netverse.id/medias/api/v2/{self._ENDPOINTS[sites_type]}/{display_id}',
display_id, data=data)
```
and define this above
```py
_ENDPOINTS = {
'watch': 'watchvideo',
...
}
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 19 | Python | 0.929 | suggestion | 299 | 44 | 44 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
traverse_obj,
ExtractorError,
# GeoRestrictedError,
)
class NetverseBaseIE(InfoExtractor):
def get_required_json(self, url, data=None):
match = self._match_valid_url(url).groupdict()
display_id, sites_type = match['display_id'], m... | ```suggestion
if json_data.get('error'):
raise ExtractorError(f'{self.IE_NAME} said: {json_data.get("message")}')
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 22 | Python | 0.929 | refactor | 140 | 47 | 47 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from ..utils import (
traverse_obj,
ExtractorError,
# GeoRestrictedError,
)
class NetverseBaseIE(InfoExtractor):
def get_required_json(self, url, data=None):
match = self._match_valid_url(url).groupdict()
display_id, sites_type = match['display_id'], match['type']
if sites_typ... | The url may contain query. Use `urllib.parse`
Also, does this even need to be a function? | from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
def _call_api(self, slug, endpoi... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 26 | Python | 0.429 | question | 92 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
json_data = self._download_json(media_api_url, display_id, data=data)
if json_data.get('error'):
raise ExtractorError(json_data.get('message'))
return json_data
def get_access_id(self, dailymotion_url):
return dailymotion_url.split('/')[-1]
def _call_metadata_api_... | ```suggestion
return self._download_json(
f'https://www.dailymotion.com/player/metadata/{req_file_type}/{access_id}',
access_id, query=query or {'embedder': 'https://www.netverse.id'})
```
This again brings into question whether this should be a separate function in the first plac... |
class NetverseIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>watch|video)/(?P<display_id>[^/?#&]+)'
_TESTS = [{
# Watch video
'url': 'https://www.netverse.id/watch/waktu-indonesia-bercanda-edisi-spesial-lebaran-2016',
'info_dict': {
'id': 'k4yhqU... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 26 | Python | 1 | suggestion | 321 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
}] # noqa
def _real_extract(self, url):
program_json = self.get_required_json(url=url)
videos = traverse_obj(program_json, ('response', 'videos'))
video_url = videos.get('dailymotion_url')
episode_order = videos.get('episode_order')
program_detail = videos.get('p... | It's preferred to keep the display id consistent if possible | 'thumbnail': r're:https?://s\d+\.dmcdn\.net/v/TfuZ_1Y6PboJ5An_s/x1080',
'season': 'Season 1',
'episode_number': 1,
'description': 'md5:d4f627b3e7a3f9acdc55f6cdd5ea41d5',
'title': 'Namaku Choi Jadoo',
'episode': 'Episode 1',
'age_limit':... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 26 | Python | 0.286 | suggestion | 60 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
# For m3u8
m3u8_file = traverse_obj(real_video_json, ('qualities', 'auto'))
for format in m3u8_file:
video_url = format.get('url')
if video_url is None:
continue
self.video_format = self._extract_m3u8_formats(video_url, video_id=video_id)
# n... | Lots of unnecessary variables. Eg:
```diff
- 'series': program_detail.get('title'),
+ 'series': travrse_obj(videos, ('program_detail', 'title')),
``` | 'skip': 'This video get Geo-blocked for some country'
}]
def _real_extract(self, url):
display_id, sites_type = self._match_valid_url(url).group('display_id', 'type')
program_json = self._call_api(display_id, sites_type)
videos = program_json['response']['videos']
retur... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 26 | Python | 0.714 | suggestion | 161 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'series': program_detail.get('title'),
'episode': episode,
}
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
_TEST = {
'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
... | ```suggestion
playlist_data = self.get_required_json(url)
webseries_info = traverse_obj(playlist_data, ('response', 'webseries_info'))
videos = traverse_obj(playlist_data, ('response', 'related', 'data'))
```
why is there space after each line!?
(Same above) | _VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
_TESTS = [{
# multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
'info_dict': {
'id': 'tetangga-masa-gitu',
'title': 'Tetangga Masa Gitu',
... | @@ -0,0 +1,174 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ ExtractorError,
+ # GeoRestrictedError,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ def get_required_json(self, url, data=None):
+ match = self._match_valid_url(url).groupdict()
+ display_id, sites... | yt_dlp/extractor/netverse.py | 26 | Python | 0.786 | suggestion | 290 | 38 | 40 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
smuggle_url,
traverse_obj,
)
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
}
def _call_api(self, url, query={}):
display_id, sites_type = self._match_valid_url(url).group('display_id', 't... | Show example of when this code is reached | 'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
def _call_api(self, slug, endpoint, query={}, season_id='', display_id=None):
return self._download_json(
f'https://api.netverse.id/medias/api/v2/{self._ENDPOINTS[endpoint]}/{slug}/{seas... | @@ -0,0 +1,167 @@
+import functools
+
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
+ OnDemandPagedList,
+ smuggle_url,
+ traverse_obj,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ _ENDPOINTS = {
+ 'wa... | yt_dlp/extractor/netverse.py | 26 | Python | 0.071 | suggestion | 41 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'series': traverse_obj(videos, ('program_detail', 'title')),
}
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
_TEST = {
'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
'info_d... | The number is the "number of videos per page". If this is not known, don't use pagedlist | _VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
_TESTS = [{
# multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
'info_dict': {
'id': 'tetangga-masa-gitu',
'title': 'Tetangga Masa Gitu',
... | @@ -0,0 +1,167 @@
+import functools
+
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
+ OnDemandPagedList,
+ smuggle_url,
+ traverse_obj,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ _ENDPOINTS = {
+ 'wa... | yt_dlp/extractor/netverse.py | 26 | Python | 0.286 | suggestion | 88 | 31 | 40 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'series': traverse_obj(videos, ('program_detail', 'title')),
}
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
_TEST = {
'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
'info_d... | will you be addressing this todo now? or should I merge without it?
```suggestion
# FIXME: get video from other season from api_url/<season_id>?page=<page>
``` | 'playlist_count': 519,
}, {
# single season
'url': 'https://netverse.id/webseries/kelas-internasional',
'info_dict': {
'id': 'kelas-internasional',
'title': 'Kelas Internasional',
},
'playlist_count': 203,
}]
def parse_playlist(self, j... | @@ -0,0 +1,175 @@
+import functools
+
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from ..utils import (
+ OnDemandPagedList,
+ smuggle_url,
+ traverse_obj,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ _ENDPOINTS = {
+ 'watch': 'watchvideo',
+ 'video': 'watchvi... | yt_dlp/extractor/netverse.py | 26 | Python | 0.786 | suggestion | 172 | 31 | 32 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
import functools
from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import (
InAdvancePagedList,
smuggle_url,
traverse_obj,
)
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webs... | ```suggestion
from ..utils import InAdvancePagedList, smuggle_url, traverse_obj
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -0,0 +1,212 @@
+import functools
+
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from ..utils import (
+ InAdvancePagedList,
+ smuggle_url,
+ traverse_obj,
+) | yt_dlp/extractor/netverse.py | 9 | Python | 0.571 | suggestion | 85 | 34 | 34 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import (
InAdvancePagedList,
smuggle_url,
traverse_obj,
)
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
's... | ```suggestion
slug = display_id = input_data
``` | from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
def _call_api(self, slug, endpoint, query={}, season_id='', display_id=... | @@ -0,0 +1,212 @@
+import functools
+
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from ..utils import (
+ InAdvancePagedList,
+ smuggle_url,
+ traverse_obj,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ _ENDPOINTS = {
+ 'watch': 'watchvideo',
+ 'video': 'watchv... | yt_dlp/extractor/netverse.py | 26 | Python | 0.571 | suggestion | 62 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .dailymotion import DailymotionIE
from ..utils import (
InAdvancePagedList,
smuggle_url,
traverse_obj,
)
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | sites_type may not exist at this point |
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
def _call_api(self, slug, endpoint, query={}, season_id='', display_id=None):
return self._download_json(
... | @@ -0,0 +1,212 @@
+import functools
+
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from ..utils import (
+ InAdvancePagedList,
+ smuggle_url,
+ traverse_obj,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ _ENDPOINTS = {
+ 'watch': 'watchvideo',
+ 'video': 'watchv... | yt_dlp/extractor/netverse.py | 26 | Python | 0.214 | suggestion | 38 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
_, playlist_json = self._call_api(
input_data, query={'page': page_num + 1}, season=season_id, custom_id=custom_id,
force_endpoint_type=force_endpoint_type, input_type=input_type)
for slug in traverse_obj(playlist_json, ('response', ..., 'data', ..., 'slug')):
yield ... | What's the point of pagedlist if you are yielding from it?? | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -141,27 +157,56 @@ def _real_extract(self, url):
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _TESTS = [{
+ # multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.214 | question | 59 | 34 | 177 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
import functools
from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import (
InAdvancePagedList,
smuggle_url,
traverse_obj,
)
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webs... | This doesn't really make sense. Try:
```suggestion
def _call_api(self, url=None, slug=None, endpoint=None, query={}, season=''):
assert (url is None and slug) or (slug is None and url)
...
```
I don't see the point of `custom_id` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -16,23 +14,23 @@ class NetverseBaseIE(InfoExtractor):
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
+ 'season': 'webseason_videos',
}
- def _call_api(self, url, query={}):
- display_id, sites_type = self._match_valid_url(url).group('display... | yt_dlp/extractor/netverse.py | 21 | Python | 0.786 | suggestion | 255 | 46 | 46 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
yield self.url_result(f'https://www.netverse.id/video/{slug}', NetverseIE)
def parse_playlist(self, url, json_data, playlist_id):
slug_sample = traverse_obj(json_data, ('related', 'data', ..., 'slug'))[0]
season_id_list = [season.get('id') for season in json_data.get('seasons')]
... | The point of `_` is that it is unused. If you want to use it, give it a name! | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -0,0 +1,212 @@
+import functools
+
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from ..utils import (
+ InAdvancePagedList,
+ smuggle_url,
+ traverse_obj,
+)
+
+
+class NetverseBaseIE(InfoExtractor):
+ _ENDPOINTS = {
+ 'watch': 'watchvideo',
+ 'video': 'watchv... | yt_dlp/extractor/netverse.py | 26 | Python | 0.429 | suggestion | 77 | 29 | 177 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .escapist import EscapistIE
from .espn import (
ESPNIE,
WatchESPNIE,
ESPNArticleIE,
FiveThirtyEightIE,
ESPNCricInfoIE,
)
from .esri import EsriVideoIE
from .europa import EuropaIE
from .europeantour import EuropeanTourIE
from .euscreen import EUScreenIE
from .expotv import ExpoTVIE
from .expres... | unrelated change
```suggestion
``` | from .escapist import EscapistIE
from .espn import (
ESPNIE,
WatchESPNIE,
ESPNArticleIE,
FiveThirtyEightIE,
ESPNCricInfoIE,
)
from .esri import EsriVideoIE
from .europa import EuropaIE
from .europeantour import EuropeanTourIE
from .euscreen import EUScreenIE
from .expotv import ExpoTVIE
from .expres... | @@ -495,7 +495,6 @@
FancodeVodIE,
FancodeLiveIE
)
- | yt_dlp/extractor/_extractors.py | 26 | Python | 0.5 | suggestion | 38 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | ```suggestion
sites_type, display_id = endpoint, slug
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -1,28 +1,29 @@
-import functools
-
from .common import InfoExtractor
from .dailymotion import DailymotionIE
-from ..utils import (
- InAdvancePagedList,
- smuggle_url,
- traverse_obj,
-)
+from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'... | yt_dlp/extractor/netverse.py | 22 | Python | 0.714 | suggestion | 71 | 47 | 47 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
# single season
'url': 'https://netverse.id/webseries/kelas-internasional',
'info_dict': {
'id': 'kelas-internasional',
'title': 'Kelas Internasional',
},
'playlist_count': 203,
}]
def parse_single_season_playlist(self, page_num, url=None, slug=No... | ```suggestion
slug=slug_sample, custom_id=playlist_id, season=season, endpoint='season')
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -149,28 +150,54 @@ def _real_extract(self, url):
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _TESTS = [{
+ # multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.714 | suggestion | 110 | 43 | 177 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'info_dict': {
'id': 'kelas-internasional',
'title': 'Kelas Internasional',
},
'playlist_count': 203,
}]
def parse_single_season_playlist(self, page_num, url=None, slug=None, custom_id=None, season_id='',
endpoint=None):
... | why non-fatal when it'll cause error in the next line? | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -149,28 +150,54 @@ def _real_extract(self, url):
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _TESTS = [{
+ # multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.429 | question | 54 | 41 | 177 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
def parse_single_season_playlist(self, page_num, url=None, slug=None, custom_id=None, season_id='',
endpoint=None):
_, playlist_json = self._call_api(
url=url, slug=slug, query={'page': page_num + 1}, season=season_id, custom_id=custom_id,
endpoi... | ```suggestion
for current_page in range(playlist_json['response']['season_list']['last_page']):
yield from self.parse_single_season_playlist(
current_page, slug=slug_sample,
custom_id=playlist_id, season_id=season, endpoint='season')
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -149,28 +150,54 @@ def _real_extract(self, url):
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _TESTS = [{
+ # multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.786 | suggestion | 310 | 34 | 177 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
},
'playlist_count': 519,
}, {
# single season
'url': 'https://netverse.id/webseries/kelas-internasional',
'info_dict': {
'id': 'kelas-internasional',
'title': 'Kelas Internasional',
},
'playlist_count': 203,
}]
def parse_singl... | ```suggestion
for season in traverse_obj(json_data, ('seasons', ..., 'id')):
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -149,28 +150,54 @@ def _real_extract(self, url):
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _TESTS = [{
+ # multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.571 | suggestion | 90 | 46 | 177 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
_TESTS = [{
# multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
'info_dict': {
'id': 'tetangga-masa-gitu',
'title': 'Tetangga Masa Gitu',
},
'playlist_count': 519,
}, {
# single season
'url': 'https://netver... | This really isn't complicated enough to warrant it's own function imo. Especially considering how all the vars has to be passed in from parse_playlist | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
... | @@ -149,28 +150,54 @@ def _real_extract(self, url):
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _TESTS = [{
+ # multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.429 | suggestion | 150 | 51 | 177 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
_TESTS = [{
# multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
'info_dict': {
'id': 'tetangga-masa-gitu',
... | ```suggestion
_, playlist_json = self._call_api(
url=url, slug=slug, query={'page': page_num + 1},
season=season_id, custom_id=custom_id, endpoint=endpoint)
``` | 'id': 'kelas-internasional',
'title': 'Kelas Internasional',
},
'playlist_count': 203,
}]
def parse_playlist(self, json_data, playlist_id):
slug_sample = traverse_obj(json_data, ('related', 'data', ..., 'slug'))[0]
for season in traverse_obj(json_data, ('... | @@ -149,28 +150,54 @@ def _real_extract(self, url):
class NetversePlaylistIE(NetverseBaseIE):
_VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
- _TEST = {
+ _TESTS = [{
+ # multiple season
'url': 'https://netverse.id/webseries/tetangga-masa-gitu'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.714 | suggestion | 196 | 51 | 27 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
def _call_api(self, url=None, sl... | These are 2 very distingct functions ixed into one. I feel like just the download_json should be in _call_api and the display_id extraction should be moved outside | from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
'season': 'webseason_videos',
}
def _call_api(self, slug, endpoi... | @@ -1,28 +1,29 @@
-import functools
-
from .common import InfoExtractor
from .dailymotion import DailymotionIE
-from ..utils import (
- InAdvancePagedList,
- smuggle_url,
- traverse_obj,
-)
+from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'... | yt_dlp/extractor/netverse.py | 26 | Python | 0.429 | refactor | 163 | 51 | 51 | false | [Netverse] Add extractor | 3,854 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'params': {
'noplaylist': False,
}
}, {
'url': 'https://now.naver.com/show/4759?shareHightlight=1078#highlight=',
'info_dict': {
'id': '4759',
'title': '아이키의 떰즈업',
},
'playlist_mincount': 48,
'params': {
'noplayl... | ```suggestion
return merge_dicts({
'id': f'{show_id}-{replay_id}',
'title': traverse_obj(vod_info, ('episode', 'title')),
'timestamp': unified_timestamp(traverse_obj(vod_info, ('episode', 'start_time'))),
'thumbnail': vod_info.get('thumbnail_image_url'),
... | },
'playlist_mincount': 48,
}]
def _extract_replay(self, show_id, replay_id):
vod_info = self._download_json(f'{self._API_URL}/shows/{show_id}/vod/{replay_id}', replay_id)
in_key = self._download_json(f'{self._API_URL}/shows/{show_id}/vod/{replay_id}/inkey', replay_id)['inKey']
... | @@ -247,3 +254,174 @@ def _extract_video_info(self, video_id, url):
'categories': [meta.get('categoryId')],
'is_live': True
}
+
+
+class NaverNowIE(NaverBaseIE):
+ IE_NAME = 'navernow'
+ _VALID_URL = r'https?://now\.naver\.com/show/(?P<id>[0-9]+)'
+ _PAGE_SIZE = 30
+ _API_... | yt_dlp/extractor/naver.py | 26 | Python | 0.857 | refactor | 403 | 51 | 51 | false | [navernow] New extractor | 3,866 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ping |
page = 0
entries = []
while True:
highlights_videos = self._download_json(
f'{self._API_URL}/shows/{show_id}/highlights/videos/', show_id,
query={'offset': page * self._PAGE_SIZE, 'limit': self._PAGE_SIZE},
note=f'Downloading JSON highl... | ```suggestion
if not self._yes_playlist(show_id, qs.get('shareHightlight')):
return self._extract_highlight(show_id, qs['shareHightlight'][0])
elif not self._yes_playlist(show_id, qs.get('shareReplayId')):
return self._extract_replay(show_id, qs['shareReplayId'][0])
``` | import itertools
import re
from urllib.parse import urlparse, parse_qs
from .common import InfoExtractor
from ..utils import (
ExtractorError,
clean_html,
dict_get,
int_or_none,
merge_dicts,
parse_duration,
traverse_obj,
try_call,
try_get,
unified_timestamp,
update_url_query... | @@ -247,3 +254,174 @@ def _extract_video_info(self, video_id, url):
'categories': [meta.get('categoryId')],
'is_live': True
}
+
+
+class NaverNowIE(NaverBaseIE):
+ IE_NAME = 'navernow'
+ _VALID_URL = r'https?://now\.naver\.com/show/(?P<id>[0-9]+)'
+ _PAGE_SIZE = 30
+ _API_... | yt_dlp/extractor/naver.py | 26 | Python | 0.857 | refactor | 317 | 41 | 387 | false | [navernow] New extractor | 3,866 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ping |
page += 1
return entries
def _real_extract(self, url):
show_id = self._match_id(url)
qs = compat_parse_qs(compat_urllib_parse_urlparse(url).query)
if qs.get('shareHightlight') and not self._yes_playlist(show_id, qs["shareHightlight"][0]):
return self._extrac... | ```suggestion
return self.playlist_result(
itertools.chain(self._extract_show_replays(show_id), self._extract_show_highlights(show_id)),
show_id, show_info.get('title'))
``` | import itertools
import re
from urllib.parse import urlparse, parse_qs
from .common import InfoExtractor
from ..utils import (
ExtractorError,
clean_html,
dict_get,
int_or_none,
merge_dicts,
parse_duration,
traverse_obj,
try_call,
try_get,
unified_timestamp,
update_url_query... | @@ -247,3 +254,174 @@ def _extract_video_info(self, video_id, url):
'categories': [meta.get('categoryId')],
'is_live': True
}
+
+
+class NaverNowIE(NaverBaseIE):
+ IE_NAME = 'navernow'
+ _VALID_URL = r'https?://now\.naver\.com/show/(?P<id>[0-9]+)'
+ _PAGE_SIZE = 30
+ _API_... | yt_dlp/extractor/naver.py | 26 | Python | 0.857 | refactor | 209 | 27 | 387 | false | [navernow] New extractor | 3,866 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ping |
'url': 'https://now.naver.com/show/4759',
'info_dict': {
'id': '4759',
'title': '아이키의 떰즈업',
},
'playlist_mincount': 48
}, {
'url': 'https://now.naver.com/show/4759?shareReplayId=5901#replay',
'info_dict': {
'id': '4759',
... | ```suggestion
}, {
'url': 'https://now.naver.com/show/4759?shareHightlight=1078#highlight=',
'info_dict': {
'id': '4759',
'title': '아이키의 떰즈업',
},
'playlist_mincount': 48,
``` | 'url': 'https://now.naver.com/show/4759',
'info_dict': {
'id': '4759',
'title': '아이키의 떰즈업',
},
'playlist_mincount': 48
}, {
'url': 'https://now.naver.com/show/4759?shareReplayId=5901#replay',
'info_dict': {
'id': '4759',
... | @@ -247,3 +253,140 @@ def _extract_video_info(self, video_id, url):
'categories': [meta.get('categoryId')],
'is_live': True
}
+
+
+class NaverNowIE(NaverBaseIE):
+ IE_NAME = 'navernow'
+ _VALID_URL = r'https?://now\.naver\.com/show/(?P<id>[0-9]+)'
+ _PAGE_SIZE = 30
+ _API_... | yt_dlp/extractor/naver.py | 26 | Python | 0.786 | suggestion | 242 | 51 | 51 | false | [navernow] New extractor | 3,866 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ping |
info = {
'id': display_id,
'title': self._html_search_regex(
r'(?s)<h1[^>]*itemprop="[^"]*name[^"]*"[^>]*>(.+?)</h1>',
webpage,
'title',
default=self._og_search_title(webpage),
),
'description': self.... | > (\d{4})-(\d{2})-(\d{2})T
Isn't this ISO-8601 formatted date time? If so,
```suggestion
'timestamp': unified_timestamp(
self._search_regex(
r'"datePublished":"([^"]+?)"', 'timestamp', webpage, fatal=False))
```
Use `self._search_regex` everywhere unless you ... | from .common import InfoExtractor
from ..utils import int_or_none, parse_duration, unified_strdate
class FranceCultureIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?radiofrance\.fr/franceculture/podcasts/(?:[^?#]+/)?(?P<display_id>[^?#]+)-(?P<id>\d+)($|[?#])'
_TESTS = [
{
'url': 'htt... | @@ -61,65 +31,68 @@ def _real_extract(self, url):
'id': display_id,
'title': self._html_search_regex(
r'(?s)<h1[^>]*itemprop="[^"]*name[^"]*"[^>]*>(.+?)</h1>',
- webpage, 'title', default=self._og_search_title(webpage)),
+ webpage,
+ ... | yt_dlp/extractor/franceculture.py | 26 | Python | 0.857 | suggestion | 361 | 51 | 47 | false | [FranceCulture] Fix extractor (#3742) | 3,874 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | aurelg |
webpage,
'description',
default=None,
),
'thumbnail': self._og_search_thumbnail(webpage),
'uploader': self._html_search_regex(
r'(?s)<span class="author">(.*?)</span>',
webpage,
'uploader'... | ```suggestion
video_data = self._parse_json(
self._search_regex(
r'({"@type":"AudioObject","contentUrl":"[^"]+","duration":"[^"]+","encodingFormat":"mp3","potentialAction":{"@type":"Action","name":"ListenAction"}})', webpage, 'video data'),
video_id)
```
Don't us... | from .common import InfoExtractor
from ..utils import int_or_none, parse_duration, unified_strdate
class FranceCultureIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?radiofrance\.fr/franceculture/podcasts/(?:[^?#]+/)?(?P<display_id>[^?#]+)-(?P<id>\d+)($|[?#])'
_TESTS = [
{
'url': 'htt... | @@ -61,65 +31,68 @@ def _real_extract(self, url):
'id': display_id,
'title': self._html_search_regex(
r'(?s)<h1[^>]*itemprop="[^"]*name[^"]*"[^>]*>(.+?)</h1>',
- webpage, 'title', default=self._og_search_title(webpage)),
+ webpage,
+ ... | yt_dlp/extractor/franceculture.py | 26 | Python | 1 | refactor | 354 | 51 | 47 | false | [FranceCulture] Fix extractor (#3742) | 3,874 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | aurelg |
)
)
video_url = video_data['contentUrl']
ext = video_data['encodingFormat']
# 'P0Y0M0DT0H38M28S'
duration = sum(
[
durations[0] * durations[1]
for durations in zip(
[
int(duration... | (actually this should be implemented in `parse_duration`) | from .common import InfoExtractor
from ..utils import int_or_none, parse_duration, unified_strdate
class FranceCultureIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?radiofrance\.fr/franceculture/podcasts/(?:[^?#]+/)?(?P<display_id>[^?#]+)-(?P<id>\d+)($|[?#])'
_TESTS = [
{
'url': 'htt... | @@ -61,65 +31,68 @@ def _real_extract(self, url):
'id': display_id,
'title': self._html_search_regex(
r'(?s)<h1[^>]*itemprop="[^"]*name[^"]*"[^>]*>(.+?)</h1>',
- webpage, 'title', default=self._og_search_title(webpage)),
+ webpage,
+ ... | yt_dlp/extractor/franceculture.py | 26 | Python | 0.429 | suggestion | 57 | 36 | 47 | false | [FranceCulture] Fix extractor (#3742) | 3,874 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | aurelg |
# use _type url_transparent to retain the meaningful details
# of the video.
return {
'_type': 'url_transparent',
'url': smuggle_url(data_url, {'http_headers': headers}),
'id': video_id,
'title': title,
'... | ```suggestion
'http_headers': headers
```
doesn't this work? | return {
'_type': 'url_transparent',
'url': smuggle_url(data_url, {'http_headers': headers}),
'id': video_id,
'title': title,
'series': series_title,
'season_number': int_or_none(season_id),
'seas... | @@ -150,36 +161,29 @@ def _real_extract(self, url):
'episode_number': int_or_none(episode_id),
'episode_id': episode_id,
'formats': formats,
- 'http_headers': {'Referer': 'https://www.duboku.co/static/player/videojs.html'}
+ 'http_headers': {'Referer': 'https... | yt_dlp/extractor/duboku.py | 26 | Python | 0.571 | question | 75 | 51 | 51 | false | [duboku] Fix hostname change and require referer | 3,891 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mozbugbox |
# from https://www.klarna.com/uk/
# with data-video-src
expect_dict(
self,
self.ie._parse_html5_media_entries(
'https://www.directvnow.com',
r'''
<video loop autoplay muted class="responsive-video block-kl__video video-on-me... | Could u split this up to be more readable? | # from https://www.klarna.com/uk/
# with data-video-src
expect_dict(
self,
self.ie._parse_html5_media_entries(
'https://www.directvnow.com',
r'''
<video loop autoplay muted class="responsive-video block-kl__video video-on-me... | @@ -502,6 +502,23 @@ def test_parse_html5_media_entries(self):
}],
})
+ # from https://0000.studio/
+ # with type attribute but without extension in URL
+ expect_dict(
+ self,
+ self.ie._parse_html5_media_entries(
+ 'https://0000.... | test/test_InfoExtractor.py | 26 | Python | 0.143 | refactor | 43 | 51 | 51 | false | [extractor/common] Recognize `src` attribute from HTML5 media elements | 3,899 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'url': 'https://ecchi.iwara.tv/users/theblackbirdcalls',
'info_dict': {
'title': 'Uploaded videos from TheBlackbirdCalls',
'id': 'theblackbirdcalls',
'uploader': 'TheBlackbirdCalls',
'uploader_id': 'theblackbirdcalls',
},
'playlist_mincount... | ```suggestion
videos_url = self._search_regex(r'<a href="(/users/[^/]+/videos)(?:\?[^"]*+)?">', webpage, 'all videos url', default=None)
``` | 'id': 'theblackbirdcalls',
'uploader': 'TheBlackbirdCalls',
'uploader_id': 'theblackbirdcalls',
},
'playlist_mincount': 420,
}, {
'note': 'foreign chars in URL. there must be foreign characters in URL',
'url': 'https://ecchi.iwara.tv/users/ぶた丼',
... | @@ -171,37 +172,78 @@ class IwaraUserIE(IwaraBaseIE):
IE_NAME = 'iwara:user'
_TESTS = [{
- 'url': 'https://ecchi.iwara.tv/users/CuteMMD',
+ # cond: videos < 40
+ 'note': 'number of all videos page is just 1 page',
+ 'url': 'https://ecchi.iwara.tv/users/infinityyukarip',
... | yt_dlp/extractor/iwara.py | 26 | Python | 0.786 | suggestion | 150 | 51 | 44 | false | [extractor/iwara:user] Make paging better | 3,901 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
formats.extend(self._extract_mpd_formats(
version_url, video_id, mpd_id='dash-%s' % version,
note='Downloading %s MPD information' % version,
errnote='Failed to download %s MPD information' % version,
fatal=False))
... | You can get the missing quality from the URL, which is already being analysed quite fully:
```diff
--- old/yt-dlp/yt_dlp/extractor/vevo.py
+++ new/yt-dlp/yt_dlp/extractor/vevo.py
@@ -138,6 +138,7 @@
fatal=False))
else:
m = re.search(r'''(?xi)
+ ... | 'ext': 'mp4',
'title': 'ABC - Viva Love',
'age_limit': 0,
'timestamp': 1461830400,
'upload_date': '20160428',
'uploader': 'ABC',
'track': 'Viva Love',
'artist': 'ABC',
'genre': 'Pop',
},
'expected... | @@ -149,7 +149,7 @@ def _real_extract(self, url):
formats.append({
'url': version_url,
- 'format_id': 'http-%s-%s' % (version, video_version['quality']),
+ 'format_id': f'http-{version}-{video_version.get("quality")}', | yt_dlp/extractor/vevo.py | 26 | Python | 0.857 | refactor | 1,049 | 51 | 51 | false | [extractor/vevo] Fix extractor | 3,921 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Lesmiscore |
version_url, video_id, mpd_id='dash-%s' % version,
note='Downloading %s MPD information' % version,
errnote='Failed to download %s MPD information' % version,
fatal=False))
elif '.m3u8' in version_url:
formats.ex... | ```suggestion
'format_id': f'http-{version}-{video_version.get("quality") or m.group("quality"))}',
``` | 'age_limit': 0,
'timestamp': 1461830400,
'upload_date': '20160428',
'uploader': 'ABC',
'track': 'Viva Love',
'artist': 'ABC',
'genre': 'Pop',
},
'expected_warnings': ['Failed to download video versions info'],
}, {
... | @@ -149,7 +151,7 @@ def _real_extract(self, url):
formats.append({
'url': version_url,
- 'format_id': 'http-%s-%s' % (version, video_version['quality']),
+ 'format_id': f'http-{version}-{video_version.get("quality", m.group("quality"))}', | yt_dlp/extractor/vevo.py | 26 | Python | 0.714 | suggestion | 125 | 51 | 51 | false | [extractor/vevo] Fix extractor | 3,921 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
version_url, video_id, mpd_id='dash-%s' % version,
note='Downloading %s MPD information' % version,
errnote='Failed to download %s MPD information' % version,
fatal=False))
elif '.m3u8' in version_url:
formats.ex... | ```suggestion
'format_id': f'http-{version}-{video_version.get("quality") or m.group("quality")}',
``` | 'age_limit': 0,
'timestamp': 1461830400,
'upload_date': '20160428',
'uploader': 'ABC',
'track': 'Viva Love',
'artist': 'ABC',
'genre': 'Pop',
},
'expected_warnings': ['Failed to download video versions info'],
}, {
... | @@ -149,7 +151,7 @@ def _real_extract(self, url):
formats.append({
'url': version_url,
- 'format_id': 'http-%s-%s' % (version, video_version['quality']),
+ 'format_id': f'http-{version}-{video_version.get("quality") or m.group("quality"))}', | yt_dlp/extractor/vevo.py | 26 | Python | 0.714 | suggestion | 124 | 51 | 51 | false | [extractor/vevo] Fix extractor | 3,921 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
js_to_json,
traverse_obj,
ExtractorError,
)
import base64
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'url': 'https://www.ixigua.com/699688... | bruh
Cookies are not supposed to be hardcoded. if u can't find a way to fetch this via api then just ask the user for cookies
But don't hardcode | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,66 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
+ _TEST = {
+ 'url':... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.429 | suggestion | 148 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | HobbyistDev |
import base64
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': 'v0d004g10000c4d1t7jc77ub4g3o88b0',
'ext': 'unknown_video',
... | ```suggestion
raise ExtractorError(f'{self.IE_NAME} said: Failed to get ssr hydyrated data')
``` | js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext'... | @@ -0,0 +1,66 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
+ _TEST = {
+ 'url':... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.929 | bug | 110 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | HobbyistDev |
'tag' : 'video_car'
# thumbnail url keep changing
}
}
HEADER = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.30',
'Cookie': '__ac_nonce=06299682f00c705b21766;ttwi... | try to see y
need more headers? need ref? need diff cookies? | 'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': 'md5:8c82f46186299add4a1c455430740229',
'tags': ['video_car'],
'like_count': int,
'dislike_count': int,
'view_count': int,
'uploader': '懂车帝原创',
'uplo... | @@ -0,0 +1,66 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
+ _TEST = {
+ 'url':... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.214 | question | 61 | 48 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | HobbyistDev |
return self._parse_json(js_data, video_id, transform_source=js_to_json)
def _real_extract(self, url):
video_id = self._match_id(url)
# need to pass cookie
webpage = self._download_webpage(url, video_id, headers=self.HEADER)
json_data = self._get_json_data(webpage, video_id)... | bruh wtf
y not use the one in url?
ID is supposed to be unique, this looks like it can change | js_data = get_element_by_id('SSR_HYDRATED_DATA', webpage)
if not js_data:
if self._cookies_passed:
raise ExtractorError('Failed to get SSR_HYDRATED_DATA')
raise ExtractorError('Cookies (not necessarily logged in) are needed', expected=True)
return self._p... | @@ -0,0 +1,66 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
+ _TEST = {
+ 'url':... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.286 | suggestion | 96 | 32 | 50 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
js_to_json,
traverse_obj,
ExtractorError,
)
import base64
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'url': 'https://www.ixigua.com/699688... | this is incorrect.
set it manually below | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,66 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
+ _TEST = {
+ 'url':... | yt_dlp/extractor/ixigua.py | 17 | Python | 0.071 | bug | 41 | 42 | 42 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | HobbyistDev |
return self._parse_json(js_data.replace('window._SSR_HYDRATED_DATA=', ''), video_id, transform_source=js_to_json)
def _get_video_format(self, video_type, video_type_json):
# select video data based on video type
video_type_based_format = {}
if video_type.startswith('dash'):
... | ```suggestion
'ext': 'mp4',
```
It's always MP4. | }]
def _get_json_data(self, webpage, video_id):
js_data = get_element_by_id('SSR_HYDRATED_DATA', webpage)
if not js_data:
if self._cookies_passed:
raise ExtractorError('Failed to get SSR_HYDRATED_DATA')
raise ExtractorError('Cookies (not necessarily logge... | @@ -54,7 +55,7 @@ def _get_video_format(self, video_type, video_type_json):
'fps': int_or_none(video.get('fps')),
'vcodec': video.get('codec_type'),
'format_id': str(video.get('quality_type')),
- 'ext': 'mp4' if parse_qs(video_url).get('mime_type')[0] ==... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.571 | suggestion | 70 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | HobbyistDev |
'width': int_or_none(video.get('vwidth')),
'height': int_or_none(video.get('vheight')),
'fps': int_or_none(video.get('fps')),
'vcodec': video.get('codec_type'),
'format_id': str(video.get('quality_type')),
'ext': 'mp4' if pa... | ```suggestion
formats = []
for video_type, video_json in video_info.items():
if not isinstance(video_json, dict):
continue
formats.extend(self._get_video_format(video_type, video_json))
``` | 'url': base64.b64decode(media['main_url']).decode(),
'width': int_or_none(media.get('vwidth')),
'height': int_or_none(media.get('vheight')),
'fps': int_or_none(media.get('fps')),
'vcodec': media.get('codec_type'),
... | @@ -0,0 +1,90 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.929 | suggestion | 251 | 39 | 33 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
int_or_none,
js_to_json,
traverse_obj,
ExtractorError,
)
import base64
from urllib.parse import parse_qs
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TES... | `10:1: F401 'urllib.parse.parse_qs' imported but unused` | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs | yt_dlp/extractor/ixigua.py | 10 | Python | 0.429 | suggestion | 56 | 35 | 35 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
int_or_none,
js_to_json,
traverse_obj,
ExtractorError,
)
import base64
from urllib.parse import parse_qs
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TES... | `22:31: W291 trailing whitespace` | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 22 | Python | 0.214 | nitpick | 33 | 47 | 47 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
int_or_none,
js_to_json,
traverse_obj,
ExtractorError,
)
import base64
from urllib.parse import parse_qs
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TES... | `24:38: W291 trailing whitespace` | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 24 | Python | 0.214 | nitpick | 33 | 49 | 49 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
int_or_none,
js_to_json,
traverse_obj,
ExtractorError,
)
import base64
from urllib.parse import parse_qs
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TES... | `25:15: E203 whitespace before ':'` | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 25 | Python | 0.214 | nitpick | 35 | 50 | 50 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
import base64
from urllib.parse import parse_qs
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext': 'm... | `34:1: W293 blank line contains whitespace` | str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.214 | nitpick | 43 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': '本期... | `39:25: W291 trailing whitespace` | class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.214 | nitpick | 33 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': '本期《懂车帝评测》,我们将尝试验证一个夏日大家可能会遇到的关键性问题:如果突发暴雨,我们不得不涉水行车,如何做才能更好保障生命安全。',
'tag': 'video_car'
},
# thumbnail url keep changing
... | `42:13: F841 local variable 'audio_data' is assigned to but never used` | 'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': 'md5:8c82f46186299add4a1c455430740229',
'tags': ['video_car'],
'like_cou... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.429 | suggestion | 71 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': '本期《懂车帝评测》,我们将尝试验证一个夏日大家可能会遇到的关键性问题:如果突发暴雨,我们不得不涉水行车,如何做才能更好保障生命安全。',
'tag': 'video_car'
},
# thumbnail url keep changing
'skip' : 'This Extra... | `43:1: W293 blank line contains whitespace` | 'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': 'md5:8c82f46186299add4a1c455430740229',
'tags': ['video_car'],
'like_count': int,
'dislike_count': int,
'view... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.214 | nitpick | 43 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
}
def _get_json_data(self, webpage, video_id):
js_data = get_element_by_id('SSR_HYDRATED_DATA', webpage)
if not js_data:
raise ExtractorError('Failed to get SSR_HYDRATED_DATA',)
return self._parse_json(js_data.replace('window._SSR_HYDRATED_DATA=', ''), video_id, transform_s... | `51:1: W293 blank line contains whitespace` | 'view_count': int,
'uploader': '懂车帝原创',
'uploader_id': '6480145787',
'thumbnail': r're:^https?://.+\.(avif|webp)',
'timestamp': 1629088414,
'duration': 1030,
}
}]
def _get_json_data(self, webpage, video_id):
js_data = get_e... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.214 | nitpick | 43 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
# video only
video_data = traverse_obj(video_type_json, ('dynamic_video', 'dynamic_video_list'))
# audio only
audio_data = traverse_obj(video_type_json, ('dynamic_video', 'dynamic_audio_list'))
video_type_based_format = {
'format_... | `64:30: W291 trailing whitespace` | raise ExtractorError('Failed to get SSR_HYDRATED_DATA')
raise ExtractorError('Cookies (not necessarily logged in) are needed', expected=True)
return self._parse_json(
js_data.replace('window._SSR_HYDRATED_DATA=', ''), video_id, transform_source=js_to_json)
def _medi... | @@ -0,0 +1,96 @@
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ ExtractorError,
+)
+import base64
+from urllib.parse import parse_qs
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:vid... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.214 | nitpick | 33 | 51 | 47 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
import base64
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'ur... | ```suggestion
import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
``` | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,118 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ str_or_none,
+ traverse_obj,
+)
+import base64 | yt_dlp/extractor/ixigua.py | 10 | Python | 1 | refactor | 213 | 35 | 35 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
import base64
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'ur... | ```suggestion
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+)'
``` | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,118 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ str_or_none,
+ traverse_obj,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9... | yt_dlp/extractor/ixigua.py | 14 | Python | 0.571 | suggestion | 93 | 39 | 39 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
_TEST = {
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': '本期《懂车帝评测》,我们将尝试验证一个夏日大家可能会遇到的关键性问题:如果突发暴雨,我们不得不涉水行车,如何做才能更好保障生命安全。',
... | easier to just use `_search_json` | _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'url': 'https://www.ixigua.com/6996881461559165471',
'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': 'md5... | @@ -0,0 +1,118 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ str_or_none,
+ traverse_obj,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.286 | suggestion | 33 | 51 | 51 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
formats_ = []
for media in json_data:
media_data = json_data.get(media)
if not isinstance(media_data, dict):
continue
if media.startswith('dash'):
video_format = self._get_media_format('dash_video', media_data)
audio_for... | ```suggestion
json_data = self._get_json_data(webpage, video_id)['anyVideo']['gidInformation']['packerData']['video']
formats = self._media_selector(video_resource.get('videoResource'))
self._sort_formats(formats)
``` | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,118 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ str_or_none,
+ traverse_obj,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.786 | suggestion | 247 | 41 | 85 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'vcodec': media.get('codec_type'),
'format_id': str_or_none(media.get('quality_type')),
'filesize': int_or_none(media.get('size')),
'ext': 'mp4',
**media_specific_format
} for media in media_json]
return _single_video_format
def _media_se... | ```py
def _media_selector(self, json_data):
for path, override in (
(('video_list',), {}),
(('dynamic_video', 'dynamic_video_list'), {'acodec': 'none'}),
(('dynamic_video', 'dynamic_audio_list'), {'vcodec': 'none', 'ext': 'm4a'}),
):
for media i... | import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_id,
int_or_none,
js_to_json,
str_or_none,
traverse_obj,
)
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>\d+).+'
_TESTS = [{
'ur... | @@ -0,0 +1,118 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ get_element_by_id,
+ int_or_none,
+ js_to_json,
+ str_or_none,
+ traverse_obj,
+)
+import base64
+
+
+class IxiguaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9... | yt_dlp/extractor/ixigua.py | 26 | Python | 0.929 | question | 1,068 | 51 | 85 | false | [ixigua] Add Extractor | 3,953 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'title': 'わたベーさんからイラスト差し入れいただきました。ありがとうございました!',
'timestamp': 1652109105,
'like_count': 1,
'uploader': 'ソエジマケイタ',
'uploader_id': 'soeji',
}
}]
def _real_extract(self, url):
video_id, uploader_id = self._match_valid_url(url).group('id',... | ```suggestion
} for url in clip_info.get('mediaFiles') or [] if url],
``` | 'like_count': 1,
'uploader': 'ソエジマケイタ',
'uploader_id': 'soeji',
}
}]
def _real_extract(self, url):
video_id, uploader_id = self._match_valid_url(url).group('id', 'uploader_id')
webpage = self._download_webpage(url, video_id)
nuxt_data = self._... | @@ -0,0 +1,111 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+# Livestreams support cannot be implemented as this service uses WebRTC for it
+# Support request may still qualify
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.571 | suggestion | 91 | 37 | 36 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | Lesmiscore |
class FourZeroStudioArchiveIE(FourZeroStudioBaseIE):
_VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/broadcasts/(?P<id>[^/]+)/archive'
IE_NAME = '0000studio:archive'
_TESTS = [{
'url': 'https://0000.studio/mumeijiten/broadcasts/1290f433-fce0-4909-a24a-5f7df09665dc/archive',
'info... | use `_and_subtitles` even if there are no subs right now | 'uploader_id': 'mumeijiten',
}
}]
def _real_extract(self, url):
video_id, uploader_id = self._match_valid_url(url).group('id', 'uploader_id')
webpage = self._download_webpage(url, video_id)
nuxt_data = self._search_nuxt_data(webpage, video_id, return_full_data=True)
... | @@ -0,0 +1,111 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+# Livestreams support cannot be implemented as this service uses WebRTC for it
+# Support request may still qualify
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.429 | suggestion | 57 | 51 | 51 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | Lesmiscore |
'title': 'わたベーさんからイラスト差し入れいただきました。ありがとうございました!',
'timestamp': 1652109105,
'like_count': 1,
'uploader': 'ソエジマケイタ',
'uploader_id': 'soeji',
}
}]
def _real_extract(self, url):
video_id, uploader_id = self._match_valid_url(url).group('id',... | fucked formatting on GH side or is it in the file?
The else block should be 1 tab right | 'like_count': 1,
'uploader': 'ソエジマケイタ',
'uploader_id': 'soeji',
}
}]
def _real_extract(self, url):
video_id, uploader_id = self._match_valid_url(url).group('id', 'uploader_id')
webpage = self._download_webpage(url, video_id)
nuxt_data = self._... | @@ -0,0 +1,111 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+# Livestreams support cannot be implemented as this service uses WebRTC for it
+# Support request may still qualify
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.286 | suggestion | 89 | 37 | 36 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | Lesmiscore |
extract_video_object(e['subjectOf'][0])
elif item_type == 'VideoObject':
extract_video_object(e)
if expected_type is None:
continue
else:
break
video = e.ge... | ```suggestion
def _search_nuxt_data(self, webpage, video_id, context_name='__NUXT__', return_full_data=False):
``` | extract_video_object(e['subjectOf'][0])
elif item_type == 'VideoObject':
extract_video_object(e)
if expected_type is None:
continue
else:
break
video = e.ge... | @@ -1568,7 +1568,7 @@ def _search_nextjs_data(self, webpage, video_id, *, transform_source=None, fatal
webpage, 'next.js data', fatal=fatal, **kw),
video_id, transform_source=transform_source, fatal=fatal)
- def _search_nuxt_data(self, webpage, video_id, context_name='__NUXT__'):
+ ... | yt_dlp/extractor/common.py | 26 | Python | 0.714 | suggestion | 120 | 51 | 51 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
from .common import InfoExtractor
from ..utils import (
traverse_obj,
unified_timestamp,
)
class FourZeroStudioBaseIE(InfoExtractor):
@staticmethod
def _extract_uploader_info(nuxt_data):
uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typename'] == 'PublicUser'), get_all... | ```suggestion
return {
'uploader': traverse_obj(nuxt_data, (
'ssrRefs', lambda _, v: v['__typename'] == 'PublicUser', 'username'), get_all=False),
}
```
The function (and the baseIE) isn't even needed imo | from .common import InfoExtractor
from ..utils import (
traverse_obj,
unified_timestamp,
)
class FourZeroStudioArchiveIE(InfoExtractor):
_VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/broadcasts/(?P<id>[^/]+)/archive'
IE_NAME = '0000studio:archive'
_TESTS = [{
'url': 'https://... | @@ -0,0 +1,108 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _extract_uploader_info(nuxt_data):
+ uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typena... | yt_dlp/extractor/fourzerostudio.py | 15 | Python | 1 | suggestion | 254 | 40 | 40 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
class FourZeroStudioArchiveIE(FourZeroStudioBaseIE):
_VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/broadcasts/(?P<id>[^/]+)/archive'
IE_NAME = '0000studio:archive'
_TESTS = [{
'url': 'https://0000.studio/mumeijiten/broadcasts/1290f433-fce0-4909-a24a-5f7df09665dc/archive',
'in... | comments returned by infodict is supposed to have a specific form
```
comments: A list of comments, each with one or more of the following
properties (all but one of text or html optional):
* "author" - human-readable name of the comment author
... | 'timestamp': 1653802534,
'release_timestamp': 1653796604,
'thumbnails': 'count:1',
'comments': 'count:7',
'uploader': '『中崎雄心』の執務室。',
'uploader_id': 'mumeijiten',
}
}]
def _real_extract(self, url):
video_id, uploader_id = se... | @@ -0,0 +1,108 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _extract_uploader_info(nuxt_data):
+ uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typena... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.857 | security | 1,390 | 51 | 51 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
_VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/broadcasts/(?P<id>[^/]+)/archive'
IE_NAME = '0000studio:archive'
_TESTS = [{
'url': 'https://0000.studio/mumeijiten/broadcasts/1290f433-fce0-4909-a24a-5f7df09665dc/archive',
'info_dict': {
'id': '1290f433-fce0-4909-a24a-... | ```suggestion
formats, subs = self._extract_m3u8_formats_and_subtitles(pcb['archiveUrl'], video_id, ext='mp4')
``` | 'comments': 'count:7',
'uploader': '『中崎雄心』の執務室。',
'uploader_id': 'mumeijiten',
}
}]
def _real_extract(self, url):
video_id, uploader_id = self._match_valid_url(url).group('id', 'uploader_id')
webpage = self._download_webpage(url, video_id)
nux... | @@ -0,0 +1,108 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _extract_uploader_info(nuxt_data):
+ uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typena... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.786 | refactor | 124 | 51 | 51 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'uploader_id': 'mumeijiten',
}
}]
def _real_extract(self, url):
video_id, uploader_id = self._match_valid_url(url).group('id', 'uploader_id')
webpage = self._download_webpage(url, video_id)
nuxt_data = self._search_nuxt_data(webpage, video_id, full_data=True)
... | ```suggestion
'thumbnails': [{
'url': pcb['thumbnailUrl'],
'ext': 'png',
}] if pcb.get('thumbnailUrl') else None,
``` | uploader_internal_id = traverse_obj(nuxt_data, (
'ssrRefs', lambda _, v: v['__typename'] == 'PublicUser', 'id'), get_all=False)
formats, subs = self._extract_m3u8_formats_and_subtitles(pcb['archiveUrl'], video_id, ext='mp4')
self._sort_formats(formats)
return {
... | @@ -0,0 +1,108 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _extract_uploader_info(nuxt_data):
+ uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typena... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.714 | suggestion | 178 | 51 | 51 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
_VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/archive-clip/(?P<id>[^/]+)'
IE_NAME = '0000studio:clip'
_TESTS = [{
'url': 'https://0000.studio/soeji/archive-clip/e46b0278-24cd-40a8-92e1-b8fc2b21f34f',
'info_dict': {
'id': 'e46b0278-24cd-40a8-92e1-b8fc2b21f34f',
... | ```suggestion
info = next((
m for m in self._parse_html5_media_entries(url, webpage, video_id)
if 'mp4' in traverse_obj(m, ('formats', ..., 'ext'))
), None)
if not info:
``` | class FourZeroStudioClipIE(InfoExtractor):
_VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/archive-clip/(?P<id>[^/]+)'
IE_NAME = '0000studio:clip'
_TESTS = [{
'url': 'https://0000.studio/soeji/archive-clip/e46b0278-24cd-40a8-92e1-b8fc2b21f34f',
'info_dict': {
'id': 'e... | @@ -0,0 +1,108 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _extract_uploader_info(nuxt_data):
+ uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typena... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.786 | suggestion | 227 | 43 | 45 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
webpage = self._download_webpage(url, video_id)
nuxt_data = self._search_nuxt_data(webpage, video_id, full_data=True)
clip_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typename'] == 'PublicCreatorArchivedClip'), get_all=False)
for m in self._parse_html5_media_entries(ur... | ```suggestion
return {
**info,
'id': video_id,
'title': clip_info.get('clipComment'),
'timestamp': unified_timestamp(clip_info.get('createdAt')),
'like_count': clip_info.get('likeCount'),
'uploader_id': uploader_id,
**se... | video_id, uploader_id = self._match_valid_url(url).group('id', 'uploader_id')
webpage = self._download_webpage(url, video_id)
nuxt_data = self._search_nuxt_data(webpage, video_id, return_full_data=True)
clip_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typename'] == 'Pub... | @@ -0,0 +1,108 @@
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ unified_timestamp,
+)
+
+
+class FourZeroStudioBaseIE(InfoExtractor):
+
+ @staticmethod
+ def _extract_uploader_info(nuxt_data):
+ uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typena... | yt_dlp/extractor/fourzerostudio.py | 26 | Python | 0.857 | performance | 373 | 27 | 29 | false | [extractor/0000studio] Add support for 00:00 Studio | 3,959 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'playlist_mincount': 13,
'info_dict': {
'id': 'data-scale-spring-2022',
'title': 'Data @Scale Spring 2022',
'description': 'md5:7d7ca1c42ac9c6d8a785092a1aea4b55'
},
}, {
'url': 'https://atscaleconference.com/events/video-scale-2021/',
'play... | ```suggestion
return self.playlist_from_matches(
re.findall(r'data-url\s*=\s*"(https?://(?:www\.)?atscaleconference\.com/videos/[^"]+)"', webpage),
ie='Generic', playlist_id=id,
title=self._og_search_title(webpage), description=self._og_search_description(webpage))
```
... | import re
from .common import InfoExtractor
class AtScaleConfEventIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?atscaleconference\.com/events/(?P<id>[^/&$?]+)'
_TESTS = [{
'url': 'https://atscaleconference.com/events/data-scale-spring-2022/',
'playlist_mincount': 13,
'info_dic... | @@ -0,0 +1,36 @@
+import re
+
+from .common import InfoExtractor
+
+
+class AtScaleConfEventIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?atscaleconference\.com/events/(?P<id>[^/&$?]+)'
+
+ _TESTS = [{
+ 'url': 'https://atscaleconference.com/events/data-scale-spring-2022/',
+ 'playlist_minc... | yt_dlp/extractor/atscaleconf.py | 26 | Python | 0.857 | refactor | 516 | 27 | 35 | false | [AtScaleConfEvent] Add IE | 3,971 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
progress_bar.print(f'Loading cookie {i: 6d}/{total_cookie_count: 6d}')
cookie = compat_cookiejar_Cookie(
version=0, name=name, value=value, port=None, port_specified=False,
domain=host, domain_specified=bool(host), domain_initial_do... | 1. `_extract_chrome_cookies` etc checks whether the folder is found. It doesn't need to be checked here`
2. Windows can be `cygwin` as well
```suggestion
if sys.platform in ('win32', 'cygwin'):
return os.path.expandvars(R'%APPDATA%\Mozilla\Firefox\Profiles')
elif sys.platform == 'darwin':
... | progress_bar.print(f'Loading cookie {i: 6d}/{total_cookie_count: 6d}')
cookie = compat_cookiejar_Cookie(
version=0, name=name, value=value, port=None, port_specified=False,
domain=host, domain_specified=bool(host), domain_initial_do... | @@ -156,30 +156,22 @@ def _extract_firefox_cookies(profile, logger):
def _firefox_browser_dir():
- if sys.platform in ('linux', 'linux2'):
- return os.path.expanduser('~/.mozilla/firefox')
- elif sys.platform == 'win32':
- return os.path.expandvars(R'%APPDATA%\Mozilla\Firefox\Profiles')
+ if... | yt_dlp/cookies.py | 26 | Python | 0.857 | refactor | 446 | 51 | 51 | false | turn cookie store detection on it's feet | 3,975 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | moench-tegeder |
comment=None, comment_url=None, rest={})
jar.set_cookie(cookie)
logger.info(f'Extracted {len(jar)} cookies from firefox')
return jar
finally:
if cursor is not None:
cursor.connection.close()
def _firefox_browser_di... | ```suggestion
if sys.platform in ('win32', 'cygwin'):
``` | comment=None, comment_url=None, rest={})
jar.set_cookie(cookie)
logger.info(f'Extracted {len(jar)} cookies from firefox')
return jar
finally:
if cursor is not None:
cursor.connection.close()
def _firefox_browser_di... | @@ -156,30 +156,22 @@ def _extract_firefox_cookies(profile, logger):
def _firefox_browser_dir():
- if sys.platform in ('linux', 'linux2'):
- return os.path.expanduser('~/.mozilla/firefox')
- elif sys.platform == 'win32':
- return os.path.expandvars(R'%APPDATA%\Mozilla\Firefox\Profiles')
+ if... | yt_dlp/cookies.py | 26 | Python | 0.571 | suggestion | 63 | 51 | 51 | false | turn cookie store detection on it's feet | 3,975 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | moench-tegeder |
with _create_progress_bar(logger) as progress_bar:
table = cursor.fetchall()
total_cookie_count = len(table)
for i, (host, name, value, path, expiry, is_secure) in enumerate(table):
progress_bar.print(f'Loading cookie {i: 6d}/{total_cookie_... | ```suggestion
return os.path.expanduser('~/.mozilla/firefox')
``` | with _create_progress_bar(logger) as progress_bar:
table = cursor.fetchall()
total_cookie_count = len(table)
for i, (host, name, value, path, expiry, is_secure) in enumerate(table):
progress_bar.print(f'Loading cookie {i: 6d}/{total_cookie_... | @@ -156,30 +156,18 @@ def _extract_firefox_cookies(profile, logger):
def _firefox_browser_dir():
- if sys.platform in ('linux', 'linux2'):
- return os.path.expanduser('~/.mozilla/firefox')
- elif sys.platform == 'win32':
+ if sys.platform in ('cygwin', 'win32'):
return os.path.expandvars(R... | yt_dlp/cookies.py | 26 | Python | 0.643 | suggestion | 71 | 51 | 51 | false | turn cookie store detection on it's feet | 3,975 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | moench-tegeder |
'display_id': 'md5:a27d1fbdeafeb740050de0e697c8e02e',
}
}, {
'url': 'https://video.kenh14.vn/playlist/tran-tinh-naked-love-mua-2-71.chn',
'note': 'Playlist URL with --flat-playlist',
'info_dict': {
'id': '316972',
'ext': 'mp4',
'descrip... | Use _extract_m3u8_formats_and_subtitles | 'title': 'Lau Lại Đầu Từ',
'description': 'Cùng xem xưa và nay có gì khác biệt nhé!',
'thumbnail': r're:^https?://kenh14cdn\.com/.*\.png$',
},
'playlist_count': 6,
}]
def _real_extract(self, url):
playlist_id = self._match_id(url)
webpage = se... | @@ -0,0 +1,321 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ extract_attributes,
+ get_element_by_class,
+ get_element_html_by_attribute,
+ get_elements_by_attribute,
+ get_elements_html_by_attribute,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ remove... | yt_dlp/extractor/kenh14.py | 26 | Python | 0.143 | refactor | 39 | 51 | 27 | false | [kenh14] Add extractor | 3,996 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | krichbanana |
display_id = self._get_display_id(page_url)
formats = self._extract_formats_wrapper(video_id, direct_url)
result = {
'id': video_id,
'title': (
clean_html(self._og_search_title(webpage))
or inline_metadata.get('video_title')
... | this should be directly in the return | from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
get_element_by_class,
get_element_html_by_attribute,
get_elements_html_by_class,
int_or_none,
parse_duration,
parse_iso8601,
remove_start,
strip_or_none,
unescapeHTML,
update_url,
... | @@ -0,0 +1,321 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ extract_attributes,
+ get_element_by_class,
+ get_element_html_by_attribute,
+ get_elements_by_attribute,
+ get_elements_html_by_attribute,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ remove... | yt_dlp/extractor/kenh14.py | 26 | Python | 0.143 | suggestion | 37 | 51 | 161 | false | [kenh14] Add extractor | 3,996 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | krichbanana |
'display_id': 'md5:db3e1b63976a664b3576f3ef68a17c9a',
},
'params': {'extract_flat': 'in_playlist'}
}]
def _try_get_redirect_url(self, webpage):
# javascript-based redirect; set via <body onload="window.location.href=URL">
url = self._search_regex(r"onload=\"window.lo... | adjust the valid_url so u can directly do:
```py
video_id, display_id = self._match_valid_url(url).group('id', 'display_id')
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
get_element_by_class,
get_element_html_by_attribute,
get_elements_html_by_class,
int_or_none,
parse_duration,
parse_iso8601,
remove_start,
strip_or_none,
unescapeHTML,
update_url,
... | @@ -0,0 +1,321 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ extract_attributes,
+ get_element_by_class,
+ get_element_html_by_attribute,
+ get_elements_by_attribute,
+ get_elements_html_by_attribute,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ remove... | yt_dlp/extractor/kenh14.py | 26 | Python | 0.714 | suggestion | 131 | 51 | 161 | false | [kenh14] Add extractor | 3,996 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | krichbanana |
'entries': _extract_playlist_videos(),
}
pass
def _get_list_videos(self, webpage):
# get_elements_html_by_class('video-item', webpage) is NOT doing what I
# expect; it's matching list-video-item for some reason
return get_elements_html_by_attribute('class', 'vide... | these need not be functions unless they are called multiple times | from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
get_element_by_class,
get_element_html_by_attribute,
get_elements_html_by_class,
int_or_none,
parse_duration,
parse_iso8601,
remove_start,
strip_or_none,
unescapeHTML,
update_url,
... | @@ -0,0 +1,321 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ extract_attributes,
+ get_element_by_class,
+ get_element_html_by_attribute,
+ get_elements_by_attribute,
+ get_elements_html_by_attribute,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ remove... | yt_dlp/extractor/kenh14.py | 26 | Python | 0.214 | suggestion | 65 | 51 | 161 | false | [kenh14] Add extractor | 3,996 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | krichbanana |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.