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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
webpage, 'ppn', group='ppn', default=None)
# if the date is not in the title
# and title is the same as the show_title
# add the date to the title
if date and not date_alt and ppn == title.lower():
title += ' del %s' % date
return {
'id': video... | ```suggestion
_VALID_URL = r'(https?://)?(www\.)?la7\.it/(?P<id>[^/]+)/podcast/?(?:$|[#?])'
``` | r'ppN:\s*([\'"])(?P<ppn>.+?)\1',
webpage, 'ppn', group='ppn', default=None)
# if the date is not in the title
# and title is the same as the show_title
# add the date to the title
if date and not date_alt and ppn and ppn.lower() == title.lower():
title... | @@ -57,3 +63,139 @@ def _real_extract(self, url):
'thumbnail': self._og_search_thumbnail(webpage, default=None),
'ie_key': 'Kaltura',
}
+
+
+class LA7PodcastEpisodeIE(InfoExtractor):
+ IE_NAME = 'la7.it:pod:episode'
+ _VALID_URL = r'''(?x)(https?://)?
+ (?:www\.)?la7\.it/... | yt_dlp/extractor/la7.py | 26 | Python | 1 | suggestion | 101 | 51 | 51 | false | [la7] Add podcast support | 198 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
webpage, 'ppn', group='ppn', default=None)
# if the date is not in the title
# and title is the same as the show_title
# add the date to the title
if date and not date_alt and ppn and ppn.lower() == title.lower():
title += ' del %s' % date
return {
... | ```suggestion
_VALID_URL = r'(https?://)?(www\.)?la7\.it/(?P<id>[^/]+)/podcast/?(?:$|[#?])'
``` | r'ppN:\s*([\'"])(?P<ppn>.+?)\1',
webpage, 'ppn', group='ppn', default=None)
# if the date is not in the title
# and title is the same as the show_title
# add the date to the title
if date and not date_alt and ppn and ppn.lower() == title.lower():
title... | @@ -57,3 +63,139 @@ def _real_extract(self, url):
'thumbnail': self._og_search_thumbnail(webpage, default=None),
'ie_key': 'Kaltura',
}
+
+
+class LA7PodcastEpisodeIE(InfoExtractor):
+ IE_NAME = 'la7.it:pod:episode'
+ _VALID_URL = r'''(?x)(https?://)?
+ (?:www\.)?la7\.it/... | yt_dlp/extractor/la7.py | 26 | Python | 1 | suggestion | 101 | 51 | 51 | false | [la7] Add podcast support | 198 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
'3600': [1440, 810],
'5000': [1920, 1080],
'10000': [1920, 1080],
}
def get_location(url, headers={}):
_url = compat_urllib_parse_urlparse(url)
conn = compat_http_client.HTTPConnection(_url.netloc)
headers.update({'Connection': 'cl... | Use this only if you cannot do what you want with `_download_webpage_handle` or even `YoutubeDL.urlopen`
I do see some other small stuff I can review, but this is the most important part | '10000': [1920, 1080],
}
def test_url(url):
resp = self._request_webpage(
HEADRequest(url), None, headers={'User-Agent': 'Rai'},
fatal=False, errnote=False, note=False)
if resp is False:
return False
if re... | @@ -96,12 +98,128 @@ def _extract_relinker_info(self, relinker_url, video_id):
if not formats and geoprotection is True:
self.raise_geo_restricted(countries=self._GEO_COUNTRIES)
+ formats.extend(self._create_http_urls(relinker_url, formats))
+
return dict((k, v) for k, v in {
... | yt_dlp/extractor/rai.py | 26 | Python | 1 | suggestion | 189 | 51 | 51 | false | [rai] add support for http formats | 208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
resp = self._request_webpage(
HEADRequest(url), None, expected_status=(200, 404),
fatal=False, errnote=False, note=False,
headers={'User-Agent': 'raiweb'})
if resp is False:
return False
if resp.code == 200:
... | Dont use `c`? Make the variable name more readable | resp = self._request_webpage(
HEADRequest(url), None, headers={'User-Agent': 'Rai'},
fatal=False, errnote=False, note=False)
if resp is False:
return False
if resp.code == 200:
return False if resp.url == url else resp... | @@ -96,12 +97,108 @@ def _extract_relinker_info(self, relinker_url, video_id):
if not formats and geoprotection is True:
self.raise_geo_restricted(countries=self._GEO_COUNTRIES)
+ formats.extend(self._create_http_urls(relinker_url, formats))
+
return dict((k, v) for k, v in {
... | yt_dlp/extractor/rai.py | 26 | Python | 0.571 | suggestion | 50 | 51 | 51 | false | [rai] add support for http formats | 208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
] if c else [None, None, None, None, None, tbr]
loc = test_url(relinker_url)
if not isinstance(loc, compat_str):
return []
base_url, vid, quality = None, None, None
mobj = re.match(_MP4_REG, loc or '')
if mobj:
base_url, vid, quality = mobj.g... | again, use more verbose name. w,h are fine. Rest are hard to understand | 'width': _QUALITY[tbr][0],
'height': _QUALITY[tbr][1],
'format_id': 'https-%s' % tbr,
'tbr': int(tbr),
}
loc = test_url(_MP4_TMPL % (relinker_url, '*'))
if not isinstance(loc, compat_str):
return []
mobj = ... | @@ -96,12 +97,108 @@ def _extract_relinker_info(self, relinker_url, video_id):
if not formats and geoprotection is True:
self.raise_geo_restricted(countries=self._GEO_COUNTRIES)
+ formats.extend(self._create_http_urls(relinker_url, formats))
+
return dict((k, v) for k, v in {
... | yt_dlp/extractor/rai.py | 26 | Python | 0.357 | suggestion | 71 | 51 | 51 | false | [rai] add support for http formats | 208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
# HLS live stream with ContentItem in og:url
'url': 'http://www.rainews.it/dl/rainews/live/ContentItem-3156f2f2-dc70-4953-8e2f-70d7489d4ce9.html',
'info_dict': {
'id': '3156f2f2-dc70-4953-8e2f-70d7489d4ce9',
'ext': 'mp4',
'title': 'La diretta di Rainews24',
... | > ContentItem in iframe (see #12652) and subtitle at 'subtitlesUrl' key
Why was this test removed? If it is obsolete, can we add equivalent test? | 'uploader': 'Rai News 24',
'creator': 'Rai News 24',
'is_live': True,
},
'params': {
'skip_download': True,
},
}]
class RaiPlayPlaylistIE(InfoExtractor):
_VALID_URL = r'(?P<base>https?://(?:www\.)?raiplay\.it/programmi/(?P<id>[^/?#&]+))'
... | @@ -350,22 +455,6 @@ class RaiIE(RaiBaseIE):
'params': {
'skip_download': True,
},
- }, {
- # ContentItem in iframe (see #12652) and subtitle at 'subtitlesUrl' key
- 'url': 'http://www.presadiretta.rai.it/dl/portali/site/puntata/ContentItem-3ed19d13-26c2-46ff-a551-b108282... | yt_dlp/extractor/rai.py | 26 | Python | 0.5 | question | 148 | 51 | 51 | false | [rai] add support for http formats | 208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
netloc='bookish-octo-barnacle.vercel.app',
query=compat_urllib_parse_urlencode(stream_query, True),
path='/api' + parsed.path)
fmt['url'] = compat_urlparse.urlunparse(parsed)
self._sort_formats(formats)
return {
'id': video_id,
... | ```suggestion
m = re.match(self._VALID_URL, url)
``` | parsed = compat_urlparse.urlparse(fmt['url'])
parsed = parsed._replace(
netloc='bookish-octo-barnacle.vercel.app',
query=compat_urllib_parse_urlencode(stream_query, True),
path='/api/mildom' + parsed.path)
fmt['url'] = compat_urlparse.u... | @@ -172,9 +173,8 @@ class MildomVodIE(MildomBaseIE):
_VALID_URL = r'https?://(?:(?:www|m)\.)mildom\.com/playback/(?P<user_id>\d+)/(?P<id>(?P=user_id)-[a-zA-Z0-9]+)'
def _real_extract(self, url):
- video_id = self._match_id(url)
- m = self._VALID_URL_RE.match(url)
- user_id = m.group('us... | yt_dlp/extractor/mildom.py | 26 | Python | 0.857 | suggestion | 62 | 51 | 51 | false | [mildom] update extractor to comply with current proxy | 212 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
uploader = try_get(
enterstudio, (
lambda x: self._html_search_meta('twitter:title', webpage),
lambda x: x['loginname'],
), compat_str)
servers = self._call_api(
'https://cloudac.mildom.com/nonolive/gappserv/live/liveserver', video_id,... | ```suggestion
# Uses https://github.com/nao20010128nao/bookish-octo-barnacle by @nao20010128nao as a proxy
``` | lambda x: x['live_intro'],
), compat_str)
uploader = try_get(
enterstudio, (
lambda x: self._html_search_meta('twitter:title', webpage),
lambda x: x['loginname'],
), compat_str)
servers = self._call_api(
'ht... | @@ -139,24 +140,24 @@ def _real_extract(self, url):
'is_lhls': '0',
})
m3u8_url = update_url_query(servers['stream_server'] + '/%s_master.m3u8' % video_id, stream_query)
- formats = self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', headers={
+ formats = self._extract_m3u... | yt_dlp/extractor/mildom.py | 26 | Python | 1 | suggestion | 124 | 51 | 51 | false | [mildom] update extractor to comply with current proxy | 212 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
def _real_extract(self, url):
display_id = self._match_id(url)
return self._get_disco_api_info(
url, display_id, 'ap2-prod-direct.discoveryplus.in', 'dplusindia', 'in')
class DiscoveryPlusIndiaShowIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/show/(?P<show_... | I dont think authority and origin should be set | }).encode('utf-8'))['data']['attributes']['streaming']
def _real_extract(self, url):
display_id = self._match_id(url)
return self._get_disco_api_info(
url, display_id, 'ap2-prod-direct.discoveryplus.in', 'dplusindia', 'in')
class DiscoveryPlusIndiaShowIE(InfoExtractor):
... | @@ -0,0 +1,99 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+import re
+
+from .common import InfoExtractor
+from .dplay import DPlayIE
+
+
+class DiscoveryPlusIndiaIE(DPlayIE):
+ _VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/videos?' + DPlayIE._PATH_REGEX
+ _TESTS = [{
+ ... | yt_dlp/extractor/discoveryplusindia.py | 26 | Python | 0.286 | security | 47 | 51 | 51 | false | [DiscoveryPlusIndia] Add DiscoveryPlusIndiaShowIE | 213 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
url, display_id, 'ap2-prod-direct.discoveryplus.in', 'dplusindia', 'in')
class DiscoveryPlusIndiaShowIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/show/(?P<show_name>\S*)'
_TESTS = [{
'url': 'https://www.discoveryplus.in/show/how-do-they-do-it',
'playlist_m... | ```suggestion
show_json = try_get(
self._download_json(
'https://ap2-prod-direct.discoveryplus.in/cms/routes/show/%s?include=default' % show_name,
show_name, headers=headers),
lambda x: x['included'][4]['attributes']['component'])
```
Don't use `.... | display_id = self._match_id(url)
return self._get_disco_api_info(
url, display_id, 'ap2-prod-direct.discoveryplus.in', 'dplusindia', 'in')
class DiscoveryPlusIndiaShowIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/show/(?P<show_name>[^/]+)/?(?:[?#]|$)'
_TEST... | @@ -0,0 +1,99 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+import re
+
+from .common import InfoExtractor
+from .dplay import DPlayIE
+
+
+class DiscoveryPlusIndiaIE(DPlayIE):
+ _VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/videos?' + DPlayIE._PATH_REGEX
+ _TESTS = [{
+ ... | yt_dlp/extractor/discoveryplusindia.py | 26 | Python | 1 | refactor | 719 | 48 | 49 | false | [DiscoveryPlusIndia] Add DiscoveryPlusIndiaShowIE | 213 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
'origin': 'https://www.discoveryplus.in',
'referer': 'https://www.discoveryplus.in/',
}
show_url = 'https://ap2-prod-direct.discoveryplus.in/cms/routes/show/{}?include=... | ```suggestion page_num = total_pages = 0
while page_num <= total_pages:
if page_num == 0:
total_pages = try_get(season_json, lambda x: x['meta']['totalPages'], int) or 0
episodes_json = self._download_json(
season_url.fo... | headers = {
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
'referer': 'https://www.discoveryplus.in/',
}
show_url = 'https://ap2-prod-direct.discoveryplus.in/cms/routes/show/{}?include=default'.format(show_name)
... | @@ -0,0 +1,99 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+import re
+
+from .common import InfoExtractor
+from .dplay import DPlayIE
+
+
+class DiscoveryPlusIndiaIE(DPlayIE):
+ _VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/videos?' + DPlayIE._PATH_REGEX
+ _TESTS = [{
+ ... | yt_dlp/extractor/discoveryplusindia.py | 26 | Python | 1 | refactor | 1,068 | 31 | 32 | false | [DiscoveryPlusIndia] Add DiscoveryPlusIndiaShowIE | 213 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
}
show_url = 'https://ap2-prod-direct.discoveryplus.in/cms/routes/show/{}?include=default'.format(show_name)
show_json = self._download_json(show_url,
video_id=show_name,
headers=headers).get('included')[4].get('attr... | You can make use of `_match_id` here for simplicity | }
show_url = 'https://ap2-prod-direct.discoveryplus.in/cms/routes/show/{}?include=default'.format(show_name)
show_json = self._download_json(show_url,
video_id=show_name,
headers=headers)['included'][4]['attributes']... | @@ -0,0 +1,99 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+import re
+
+from .common import InfoExtractor
+from .dplay import DPlayIE
+
+
+class DiscoveryPlusIndiaIE(DPlayIE):
+ _VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/videos?' + DPlayIE._PATH_REGEX
+ _TESTS = [{
+ ... | yt_dlp/extractor/discoveryplusindia.py | 26 | Python | 0.571 | suggestion | 51 | 27 | 28 | false | [DiscoveryPlusIndia] Add DiscoveryPlusIndiaShowIE | 213 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'info_dict': {
'id': 'how-do-they-do-it',
},
}
]
def _entries(self, show_name):
headers = {
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
'referer': 'https://www.discoveryplus.in/',
}
... | I am not a fan of this kind of tabbing, but I guess that is just a matter of personal preference | 'playlist_mincount': 140,
'info_dict': {
'id': 'how-do-they-do-it',
},
}
]
def _entries(self, show_name):
headers = {
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
'referer': 'https://w... | @@ -66,33 +67,32 @@ class DiscoveryPlusIndiaShowIE(InfoExtractor):
def _entries(self, show_name):
headers = {
- 'authority': 'ap2-prod-direct.discoveryplus.in',
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
- 'orig... | yt_dlp/extractor/discoveryplusindia.py | 26 | Python | 0.357 | suggestion | 96 | 39 | 40 | false | [DiscoveryPlusIndia] Add DiscoveryPlusIndiaShowIE | 213 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'id': 'how-do-they-do-it',
},
}
]
def _entries(self, show_name):
headers = {
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
'referer': 'https://www.discoveryplus.in/',
}
show_url = 'http... | Use try_get here since even if this fails, the extraction can continue.
```suggestion
total_pages = try_get(season_json, lambda x: x['meta']['totalPages'], int) or 1
``` | 'info_dict': {
'id': 'how-do-they-do-it',
},
}
]
def _entries(self, show_name):
headers = {
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
'referer': 'https://www.discoveryplus.in/',
}
... | @@ -66,33 +67,32 @@ class DiscoveryPlusIndiaShowIE(InfoExtractor):
def _entries(self, show_name):
headers = {
- 'authority': 'ap2-prod-direct.discoveryplus.in',
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod',
'x-disco-params': 'realm=dplusindia',
- 'orig... | yt_dlp/extractor/discoveryplusindia.py | 26 | Python | 1 | bug | 194 | 38 | 39 | false | [DiscoveryPlusIndia] Add DiscoveryPlusIndiaShowIE | 213 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..compat import compat_str
from .common import InfoExtractor
from .dplay import DPlayIE
from ..utils import try_get
class DiscoveryPlusIndiaIE(DPlayIE):
_VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/videos?' + DPlayIE._PATH... | ```suggestion
from ..compat import compat_str
from ..utils import try_get
from .common import InfoExtractor
from .dplay import DPlayIE
``` | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..compat import compat_str
from ..utils import try_get
from .common import InfoExtractor
from .dplay import DPlayIE
class DiscoveryPlusIndiaIE(DPlayIE):
_VALID_URL = r'https?://(?:www\.)?discoveryplus\.in/videos?' + DPlayIE._PATH... | @@ -0,0 +1,100 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+import re
+
+from ..compat import compat_str
+from .common import InfoExtractor
+from .dplay import DPlayIE
+from ..utils import try_get | yt_dlp/extractor/discoveryplusindia.py | 10 | Python | 1 | refactor | 143 | 35 | 35 | false | [DiscoveryPlusIndia] Add DiscoveryPlusIndiaShowIE | 213 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'title': 'Competitive Equity - 01/21/2015',
# 'url': 'https://cfhls.nfhsnetwork.com/121689/121689.m3u8',
'description': 'Committee members discuss points of their research regarding a competitive equity plan',
'uploader': 'WIAA - Wisconsin: Wisconsin Interscholastic Athl... | If key isnt found, it should give `None`, not `''`. Same for uploader | 'uploader': 'WIAA - Wisconsin: Wisconsin Interscholastic Athletic Association',
'uploader_id': 'a49f7d1002',
'uploader_url': 'https://www.nfhsnetwork.com/associations/wiaa-wi',
'location': 'Stevens Point, Wisconsin',
'timestamp': 1421856000,
'uploa... | @@ -0,0 +1,136 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 0.571 | suggestion | 69 | 51 | 51 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'upload_date': '20150121'
},
'params': {
# m3u8 download
'skip_download': True,
}
}
]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data = self._download_json(
... | Split long lines like this:
```suggestion
title = (
self._og_search_title(webpage)
or self._html_search_regex(r'<h1 class="sr-hidden">(.*?)</h1>', webpage, 'title'))
```
or
```suggestion
title = (self._og_search_title(webpage)
or self._html_search_re... | },
'params': {
# m3u8 download
'skip_download': True,
}
}
]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data = self._download_json(
'https://cfunity.nfhsnetwo... | @@ -0,0 +1,136 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 1 | suggestion | 384 | 51 | 51 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
},
'params': {
# m3u8 download
'skip_download': True,
}
}
]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data = self._download_json(
'https://cfunity.nfhsnetwo... | ```suggestion
title = title.split('|')[0]
```
is much more readable imo | 'params': {
# m3u8 download
'skip_download': True,
}
}
]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data = self._download_json(
'https://cfunity.nfhsnetwork.com/v2/g... | @@ -0,0 +1,136 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 0.857 | suggestion | 82 | 51 | 51 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'https://cfunity.nfhsnetwork.com/v2/game_or_event/' + video_id,
video_id)
publisher = data.get('publishers')[0] # always exists
broadcast = (publisher.get('broadcasts') or publisher.get('vods'))[0] # some (older) videos don't have a broadcasts object
uploader = publishe... | ```suggestion
formats =self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', live=isLive)
self._sort_formats(formats)
```
1. Since there are no other formats than the ones extracted from the m3u8, failures should be fatal
2. For same reason, no need to create an array and then extend
3. live vid... | video_id)
publisher = data.get('publishers')[0] # always exists
broadcast = (publisher.get('broadcasts') or publisher.get('vods'))[0] # some (older) videos don't have a broadcasts object
uploader = publisher.get('formatted_name') or publisher.get('name')
uploaderID = publis... | @@ -0,0 +1,136 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 1 | bug | 842 | 39 | 47 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'ext': 'mp4',
'title': 'Competitive Equity - 01/21/2015',
# 'url': 'https://cfhls.nfhsnetwork.com/121689/121689.m3u8',
'description': 'Committee members discuss points of their research regarding a competitive equity plan',
'uploader': 'WIAA - Wisconsin: Wisc... | Use `'%s, %s' % (var1, var2)` when possible. Similar in other places | 'description': 'Committee members discuss points of their research regarding a competitive equity plan',
'uploader': 'WIAA - Wisconsin: Wisconsin Interscholastic Athletic Association',
'uploader_id': 'a49f7d1002',
'uploader_url': 'https://www.nfhsnetwork.com/associations/... | @@ -0,0 +1,136 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 0.571 | suggestion | 68 | 51 | 51 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data = self._download_json(
'https://cfunity.nfhsnetwork.com/v2/game_or_event/' + video_id,
video_id)
publisher = data.get('publishers')[0] # always e... | can be simplified to something like:
```suggestion
video_type = 'vods' if broadcast.get('status') == 'complete' else 'broadcasts'
m3u8_url = self._download_json(
'https://cfunity.nfhsnetwork.com/v2/%s/%s/url' % (video_type, broadcast.get('key')),
video_id).get('video_url')... | video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data = self._download_json(
'https://cfunity.nfhsnetwork.com/v2/game_or_event/' + video_id,
video_id)
publisher = data.get('publishers')[0] # always exists
broadcast = (publish... | @@ -0,0 +1,136 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 1 | question | 421 | 43 | 51 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
unified_strdate,
unified_timestamp
)
class NFHSNetworkIE(InfoExtractor):
IE_NAME = 'NFHSNetwork'
_VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events/[\w-]+/(?P<id>(?:gam|evt|dd|)?[\... | url and md5 are not needed for m3u8 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
try_get,
unified_strdate,
unified_timestamp
)
class NFHSNetworkIE(InfoExtractor):
IE_NAME = 'NFHSNetwork'
_VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events/[\w-]+/(?P<id>(?:ga... | @@ -0,0 +1,136 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events... | yt_dlp/extractor/nfhsnetwork.py | 24 | Python | 0.071 | suggestion | 35 | 49 | 49 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'info_dict': {
'id': '9aa2f92f82',
'ext': 'mp4',
'title': 'Competitive Equity - 01/21/2015',
'description': 'Committee members discuss points of their research regarding a competitive equity plan',
'uploader': 'WIAA - Wisconsin: Wisconsin Interscholas... | ```suggestion
uploader = publisher.get('formatted_name') or publisher.get('name')
```
I think you misunderstood me. `.get` already returns `None` when the key isnt found | # m3u8 download
'skip_download': True,
}
}, {
# Video with no broadcasts object
'url': 'https://www.nfhsnetwork.com/events/wiaa-wi/9aa2f92f82',
'info_dict': {
'id': '9aa2f92f82',
'ext': 'mp4',
'title': 'Competitive Equity -... | @@ -0,0 +1,126 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ try_get,
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwo... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 1 | suggestion | 182 | 51 | 51 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
timestamp = unified_timestamp(data.get('local_start_time'))
upload_date = unified_strdate(data.get('local_start_time'))
title = (
self._og_search_title(webpage)
or self._html_search_regex(r'<h1 class="sr-hidden">(.*?)</h1>', webpage, 'title'))
title = title.split... | Since the extraction cannot proceed anyway without a `key`, you can use `broadcast['key'] if isLive else publisher['vods'][0]['key']`
`.get` and `try_get` are mandatory only when the the obtained values are not essential for downloading the video. Ofc, there is no harm in using `try_get` anyway. So I am not asking t... | video_id)
publisher = data.get('publishers')[0] # always exists
broadcast = (publisher.get('broadcasts') or publisher.get('vods'))[0] # some (older) videos don't have a broadcasts object
uploader = publisher.get('formatted_name') or publisher.get('name')
uploaderID = publis... | @@ -0,0 +1,126 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ try_get,
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwo... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 1 | refactor | 372 | 29 | 47 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
try_get,
unified_strdate,
unified_timestamp
)
class NFHSNetworkIE(InfoExtractor):
IE_NAME = 'NFHSNetwork'
_VALID_URL = r'https?://(?:www\.)?nfhsnetwork\.com/events/[\w-]+/(?P<id>(?:ga... | reminder to myself to check before merging whether `('res', 'tbr')` is actually the best option here | uploaderPrefix = (
"schools" if pubType == "school"
else "associations" if "association" in pubType
else "affiliates" if (pubType == "publisher" or pubType == "affiliate")
else "schools")
uploaderPage = 'https://www.nfhsnetwork.com/%s/%s' % (uploaderPrefix... | @@ -0,0 +1,126 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+from ..utils import (
+ try_get,
+ unified_strdate,
+ unified_timestamp
+)
+
+
+class NFHSNetworkIE(InfoExtractor):
+ IE_NAME = 'NFHSNetwork'
+ _VALID_URL = r'https?://(?:www\.)?nfhsnetwo... | yt_dlp/extractor/nfhsnetwork.py | 26 | Python | 0.5 | suggestion | 100 | 127 | 41 | false | Add NFHS Network extractor | 217 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'thumbnail': r're:^https?://.*\.jpg$',
'uploader': 'Le Doc',
'uploader_id': 'Le___Doc',
'uploader_url': 'https://%s/Le___Doc' % current_instance,
'upload_date': '20200829',
'timestamp': 1598711341,
'view_coun... | ```suggestion
}, { # not the first tweet but main-tweet
``` | 'thumbnail': r're:^https?://.*\.jpg$',
'uploader': 'Le Doc',
'uploader_id': 'Le___Doc',
'uploader_url': 'https://%s/Le___Doc' % current_instance,
'upload_date': '20200829',
'timestamp': 1598711341,
'view_coun... | @@ -73,31 +113,51 @@ class NitterIE(InfoExtractor):
'comment_count': int,
},
}, { # video embed in a "Streaming Political Ads" box
- 'url': 'https://' + current_instance + '/mozilla/status/1321147074491092994#m',
+ 'url': 'https://%s/mozilla/status/132114707... | yt_dlp/extractor/nitter.py | 26 | Python | 0.857 | suggestion | 70 | 51 | 51 | false | [nitter] Fix nitter extractor | 218 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | B0pol |
response = try_get(browse,
(lambda x: x['response'],
lambda x: x[1]['response'])) or {}
if response.get('continuationContents'):
break
# YouTube sometimes ... | ```suggestion
response,
lambda x: x['responseContext']['webResponseContextExtensionData']['ytConfigData']['visitorData'],
compat_str) or visitor_data
``` | session_token = try_get(browse, lambda x: x['xsrf_token'], compat_str)
if session_token:
session_token_list[0] = session_token
response = try_get(browse,
(lambda x: x['response'],
... | @@ -1694,6 +1716,8 @@ def extract_thread(parent_renderer):
if not response:
break
+ visitor_data = try_get(
+ response, lambda x: x['responseContext']['webResponseContextExtensionData']['ytConfigData']['visitorData'], compat_str) or visitor_data | yt_dlp/extractor/youtube.py | 26 | Python | 1 | suggestion | 205 | 51 | 51 | false | [youtube] Use INNERTUBE_CONTEXT and x-goog-visitor-id header for API requests. | 230 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
'clientName': client_name,
'clientVersion': client_version,
}
}
visitor_data = try_get(ytcfg, lambda x: x['VISITOR_DATA'],
compat_str)
if visitor_data:
context['client']['visitorData'] = visitor_data
r... | We always download from `www.youtube.com` even if the link given by user is from another subdomain
```suggestion
headers['X-Origin'] = 'https://www.youtube.com'
``` | # Recreate the client context (required)
client_version = self.__extract_client_version(ytcfg)
client_name = try_get(ytcfg, lambda x: x['INNERTUBE_CLIENT_NAME'], compat_str) or 'WEB'
context = {
'client': {
'clientName': client_name,
'clientVer... | @@ -358,7 +344,48 @@ def _extract_ytcfg(self, video_id, webpage):
return self._parse_json(
self._search_regex(
r'ytcfg\.set\s*\(\s*({.+?})\s*\)\s*;', webpage, 'ytcfg',
- default='{}'), video_id, fatal=False)
+ default='{}'), video_id, fatal=False) or ... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | suggestion | 179 | 51 | 51 | false | [youtube] Use INNERTUBE_CONTEXT and x-goog-visitor-id header for API requests. | 230 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
_YT_INITIAL_DATA_RE = r'(?:window\s*\[\s*["\']ytInitialData["\']\s*\]|ytInitialData)\s*=\s*({.+?})\s*;'
_YT_INITIAL_PLAYER_RESPONSE_RE = r'ytInitialPlayerResponse\s*=\s*({.+?})\s*;'
_YT_INITIAL_BOUNDARY_RE = r'(?:var\s+meta|</script|\n)'
def _generate_sapisidhash_header(self):
sapisid_cookie = ... | Since we are generalizing, see if we can get this key from the webpage as well | _YT_INNERTUBE_API_KEY = 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8'
_YT_INITIAL_DATA_RE = r'(?:window\s*\[\s*["\']ytInitialData["\']\s*\]|ytInitialData)\s*=\s*({.+?})\s*;'
_YT_INITIAL_PLAYER_RESPONSE_RE = r'ytInitialPlayerResponse\s*=\s*({.+?})\s*;'
_YT_INITIAL_BOUNDARY_RE = r'(?:var\s+meta|</script|\n)'
... | @@ -312,18 +298,18 @@ def _generate_sapisidhash_header(self):
return "SAPISIDHASH %s_%s" % (time_now, sapisidhash)
def _call_api(self, ep, query, video_id, fatal=True, headers=None,
- note='Downloading API JSON', errnote='Unable to download API page'):
- data = self._DEFAULT_API_... | yt_dlp/extractor/youtube.py | 26 | Python | 0.143 | suggestion | 78 | 51 | 51 | false | [youtube] Use INNERTUBE_CONTEXT and x-goog-visitor-id header for API requests. | 230 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
def _extract_ytcfg(self, video_id, webpage):
return self._parse_json(
self._search_regex(
r'ytcfg\.set\s*\(\s*({.+?})\s*\)\s*;', webpage, 'ytcfg',
default='{}'), video_id, fatal=False) or {}
def __extract_client_version(self, ytcfg):
return try_get(y... | ```suggestion
visitor_data = try_get(ytcfg, lambda x: x['VISITOR_DATA'], compat_str)
``` | or '').split("||")
if len(sync_ids) >= 2 and sync_ids[1]:
# datasyncid is of the form "channel_syncid||user_syncid" for secondary channel
# and just "user_syncid||" for primary channel. We only want the channel_syncid
return sync_ids[0]
def _extract_ytcfg(sel... | @@ -358,7 +344,48 @@ def _extract_ytcfg(self, video_id, webpage):
return self._parse_json(
self._search_regex(
r'ytcfg\.set\s*\(\s*({.+?})\s*\)\s*;', webpage, 'ytcfg',
- default='{}'), video_id, fatal=False)
+ default='{}'), video_id, fatal=False) or ... | yt_dlp/extractor/youtube.py | 26 | Python | 0.857 | suggestion | 98 | 51 | 51 | false | [youtube] Use INNERTUBE_CONTEXT and x-goog-visitor-id header for API requests. | 230 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
def _extract_api_key(self, ytcfg=None):
return try_get(ytcfg, lambda x: x['INNERTUBE_API_KEY'], compat_str) or self._YT_INNERTUBE_API_KEY
def _extract_yt_initial_data(self, video_id, webpage):
return self._parse_json(
self._search_regex(
(r'%s\s*%s' % (self._YT_INITI... | ```suggestion
@param data Either response or ytcfg
```
This is the standard, although I probably missed this in the earlier PRs | def _extract_api_key(self, ytcfg=None):
return try_get(ytcfg, lambda x: x['INNERTUBE_API_KEY'], compat_str) or self._YT_INNERTUBE_API_KEY
def _extract_yt_initial_data(self, video_id, webpage):
return self._parse_json(
self._search_regex(
(r'%s\s*%s' % (self._YT_INITI... | @@ -336,14 +336,20 @@ def _extract_identity_token(self, webpage, item_id):
@staticmethod
def _extract_account_syncid(data):
- """Extract syncId required to download private playlists of secondary channels"""
- sync_ids = (
- try_get(data, lambda x: x['responseContext']['mainAppWebRe... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | suggestion | 140 | 51 | 51 | false | [youtube] Improve channel syncid extraction to support ytcfg | 241 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
class TubiTvShowIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tubitv\.com/series/[0-9]+/(?P<show_name>\S*)(?:\?\S*)'
_TESTS = [{
'url': 'https://tubitv.com/series/3936/the-joy-of-painting-with-bob-ross?start=true',
'playlist_mincount': 390,
'info_dict': {
'id': 'the-j... | ```suggestion
return self.playlist_result(self._entries(url, show_name), playlist_id=show_name)
``` |
class TubiTvShowIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tubitv\.com/series/[0-9]+/(?P<show_name>[^/?#]+)'
_TESTS = [{
'url': 'https://tubitv.com/series/3936/the-joy-of-painting-with-bob-ross?start=true',
'playlist_mincount': 390,
'info_dict': {
'id': 'the-joy-o... | @@ -108,3 +113,30 @@ def _real_extract(self, url):
'uploader_id': video_data.get('publisher_id'),
'release_year': int_or_none(video_data.get('year')),
}
+
+
+class TubiTvShowIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?tubitv\.com/series/[0-9]+/(?P<show_name>\S*)(?:\?\S*)... | yt_dlp/extractor/tubitv.py | 26 | Python | 1 | suggestion | 109 | 27 | 26 | false | [TubiTv]Add TubiTvShowIE. | 243 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'formats': formats,
'subtitles': subtitles,
'thumbnails': thumbnails,
'description': video_data.get('description'),
'duration': int_or_none(video_data.get('duration')),
'uploader_id': video_data.get('publisher_id'),
'release_year': int_... | Is it a `js` or `json`? If `js`, use `self._parse_json(... , transform=js_to_json)`
```py
show_webpage = self._download_webpage(show_url, show_name).replace('undefined', '\"undefined\"')
```
should probably be implemented in `js_to_json` too | 'title': title,
'formats': formats,
'subtitles': subtitles,
'thumbnails': thumbnails,
'description': video_data.get('description'),
'duration': int_or_none(video_data.get('duration')),
'uploader_id': video_data.get('publisher_id'),
... | @@ -108,3 +113,30 @@ def _real_extract(self, url):
'uploader_id': video_data.get('publisher_id'),
'release_year': int_or_none(video_data.get('year')),
}
+
+
+class TubiTvShowIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?tubitv\.com/series/[0-9]+/(?P<show_name>\S*)(?:\?\S*)... | yt_dlp/extractor/tubitv.py | 26 | Python | 1 | suggestion | 247 | 36 | 35 | false | [TubiTv]Add TubiTvShowIE. | 243 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
sanitized_Request,
urlencode_postdata,
js_to_json
)
class TubiTvIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
... | ```suggestion
int_or_none,
js_to_json,
sanitized_Request,
urlencode_postdata,
```
Imports are done in alphabetical order for consistency | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
js_to_json,
sanitized_Request,
urlencode_postdata,
)
class TubiTvIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
... | @@ -9,11 +9,17 @@
int_or_none,
sanitized_Request,
urlencode_postdata,
+ js_to_json | yt_dlp/extractor/tubitv.py | 12 | Python | 1 | security | 160 | 37 | 37 | false | [TubiTv]Add TubiTvShowIE. | 243 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
class YoutubeSearchIE(SearchInfoExtractor, YoutubeBaseInfoExtractor):
IE_DESC = 'YouTube.com searches, "ytsearch" keyword'
# there doesn't appear to be a real limit, for example if you search for
# 'python' you get more than 8.000.000 results
_MAX_RESULTS = float('inf')
IE_NAME = 'youtube:search'
... | Wasn't quite sure what we should do here to let YoutubeSearchIE access extract_response. | user_id = self._match_id(url)
return self.url_result(
'https://www.youtube.com/user/%s' % user_id,
ie=YoutubeTabIE.ie_key(), video_id=user_id)
class YoutubeFavouritesIE(YoutubeBaseInfoExtractor):
IE_NAME = 'youtube:favorites'
IE_DESC = 'YouTube.com liked videos, ":ytfav... | @@ -3534,7 +3559,7 @@ def _real_extract(self, url):
ie=YoutubeTabIE.ie_key())
-class YoutubeSearchIE(SearchInfoExtractor, YoutubeBaseInfoExtractor):
+class YoutubeSearchIE(SearchInfoExtractor, YoutubeTabIE): | yt_dlp/extractor/youtube.py | 26 | Python | 0.357 | refactor | 88 | 51 | 51 | false | [youtube:tab] Generalise retry method for API calls | 245 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
js_to_json,
qualities,
try_get,
url_or_none,
urljoin,
)
class MxplayerIE(InfoExtractor):
_VALID_URL = r'(?:https?://)(?:www\.)?mxplaye... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?mxplayer\.in/(?:movie|show/[-\w]+/[-\w]+)/(?P<display_id>[-\w]+)-(?P<id>\w+)'
```
may be easier to read. Or even better, split it into multiple lines using `(?x)` | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
js_to_json,
qualities,
try_get,
url_or_none,
urljoin,
)
class MxplayerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mxplayer\.i... | @@ -14,7 +15,7 @@
class MxplayerIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?mxplayer\.in/(?:show|movie)/(?:(?P<display_id>[-/a-z0-9]+)-)?(?P<id>[a-z0-9]+)'
+ _VALID_URL = r'(?:https?://)(?:www\.)?mxplayer\.in/(?:show/[-\w]+/[-\w]+|movie)/(?P<display_id>[-\w]+)-(?P<id>\w+)' | yt_dlp/extractor/mxplayer.py | 18 | Python | 1 | suggestion | 217 | 43 | 43 | false | [Mxplayer]Add MxplayerShowIE. | 270 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
def _entries(self, show_id):
show_url = "https://api.mxplay.com/v1/web/detail/tab/tvshowseasons?type=tv_show&id={}&device-density=2&platform=com.mxplay.desktop&content-languages=hi,en".format(
show_id)
episodes_url = "https://api.mxplay.com/v1/web/detail/tab/tvshowepisodes?type=season&i... | ```suggestion
return self.playlist_result(self._entries(show_id), playlist_id=show_id)
```
There must be new line at end of file | }
}]
_API_SHOW_URL = "https://api.mxplay.com/v1/web/detail/tab/tvshowseasons?type=tv_show&id={}&device-density=2&platform=com.mxplay.desktop&content-languages=hi,en"
_API_EPISODES_URL = "https://api.mxplay.com/v1/web/detail/tab/tvshowepisodes?type=season&id={}&device-density=1&platform=com.mxplay.d... | @@ -125,3 +126,39 @@ def _real_extract(self, url):
'series': try_get(video_dict, lambda x: x['container']['container']['title']),
'thumbnails': thumbnails,
}
+
+class MxplayerShowIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?mxplayer\.in/show/(?P<display_id>[-\w]+)-(?P... | yt_dlp/extractor/mxplayer.py | 26 | Python | 1 | suggestion | 143 | 26 | 34 | false | [Mxplayer]Add MxplayerShowIE. | 270 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
if stream_type == 'dash':
dash_formats = self._extract_mpd_formats(
format_url, video_id, mpd_id='dash-%s' % quality, headers={'Referer': url})
for frmt in dash_formats:
frmt['quality'] = get_quality(quality)
formats.ext... | If `display_id` is never being used, don't capture it | if stream_type == 'dash':
dash_formats = self._extract_mpd_formats(
format_url, video_id, mpd_id='dash-%s' % quality, headers={'Referer': url})
for frmt in dash_formats:
frmt['quality'] = get_quality(quality)
formats.ext... | @@ -125,3 +126,40 @@ def _real_extract(self, url):
'series': try_get(video_dict, lambda x: x['container']['container']['title']),
'thumbnails': thumbnails,
}
+
+
+class MxplayerShowIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?mxplayer\.in/show/(?P<display_id>[-\w]+)-(... | yt_dlp/extractor/mxplayer.py | 26 | Python | 0.571 | suggestion | 53 | 51 | 51 | false | [Mxplayer]Add MxplayerShowIE. | 270 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
class MxplayerShowIE(InfoExtractor):
_VALID_URL = r'(?:https?://)(?:www\.)?mxplayer\.in/show/(?P<display_id>[-\w]+)-(?P<id>\w+)/?(?:$|[#?])'
_TESTS = [{
'url': 'https://www.mxplayer.in/show/watch-chakravartin-ashoka-samrat-series-online-a8f44e3cc0814b5601d17772cedf5417',
'playlist_mincount': 440... | ```suggestion
next_url = season_json.get('next')
``` | class MxplayerShowIE(InfoExtractor):
_VALID_URL = r'(?:https?://)(?:www\.)?mxplayer\.in/show/(?P<display_id>[-\w]+)-(?P<id>\w+)/?(?:$|[#?])'
_TESTS = [{
'url': 'https://www.mxplayer.in/show/watch-chakravartin-ashoka-samrat-series-online-a8f44e3cc0814b5601d17772cedf5417',
'playlist_mincount': 440... | @@ -125,3 +126,40 @@ def _real_extract(self, url):
'series': try_get(video_dict, lambda x: x['container']['container']['title']),
'thumbnails': thumbnails,
}
+
+
+class MxplayerShowIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?mxplayer\.in/show/(?P<display_id>[-\w]+)-(... | yt_dlp/extractor/mxplayer.py | 26 | Python | 0.857 | suggestion | 70 | 36 | 42 | false | [Mxplayer]Add MxplayerShowIE. | 270 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
from ..compat import compat_str
class WhoWatchIE(InfoExtractor):
IE_NAME = 'whowatch'
_VALID_URL = r'https?://whowatch\.tv/viewer/(?P<id>\d+)'
_TESTS = [{
'url': 'https://whowatch.tv/viewer/21450171',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self... | ```suggestion
raise ExtractorError(live_data.get('error_message') or 'The user is offline.', expected=True)
``` | ExtractorError,
)
from ..compat import compat_str
class WhoWatchIE(InfoExtractor):
IE_NAME = 'whowatch'
_VALID_URL = r'https?://whowatch\.tv/viewer/(?P<id>\d+)'
_TESTS = [{
'url': 'https://whowatch.tv/viewer/21450171',
'only_matching': True,
}]
def _real_extract(self, url):
... | @@ -0,0 +1,84 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ try_get,
+ ExtractorError,
+)
+from ..compat import compat_str
+
+
+class WhoWatchIE(InfoExtractor):
+ IE_NAME = 'whowatch'
+ _VALID_URL = r'https?://whowatch\.tv/viewer/(... | yt_dlp/extractor/whowatch.py | 26 | Python | 1 | refactor | 125 | 51 | 51 | false | [whowatch] add support for whowatch.tv (closes #223) | 292 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
if rtmp_url and not audio_only:
formats.append({
'url': rtmp_url,
'format_id': 'rtmp-%s' % name,
'ext': 'mp4',
'protocol': 'rtmp_ffmpeg', # ffmpeg can, while rtmpdump can't
'vcodec': 'h264',
... | ```suggestion
timestamp = int_or_none(try_get(metadata, lambda x: x['live']['started_at']), scale=1000)
```
see below | 'url': rtmp_url,
'format_id': 'rtmp-%s' % name,
'ext': 'mp4',
'protocol': 'rtmp_ffmpeg', # ffmpeg can, while rtmpdump can't
'vcodec': 'h264',
'acodec': 'aac',
'quality': quality,
... | @@ -67,18 +73,28 @@ def _real_extract(self, url):
self._sort_formats(formats)
- uploader_id = try_get(metadata, lambda x: x['live']['user']['user_path'], compat_str)
- uploader_id_internal = try_get(metadata, lambda x: x['live']['user']['id'], int)
+ uploader_url = try_get(metadata, la... | yt_dlp/extractor/whowatch.py | 26 | Python | 1 | suggestion | 130 | 43 | 44 | false | [whowatch] add support for whowatch.tv (closes #223) | 292 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'height': try_get(hls_fmts, lambda x: x[0]['height'], int),
})
self._sort_formats(formats)
uploader_url = try_get(metadata, lambda x: x['live']['user']['user_path'], compat_str)
if uploader_url:
uploader_url = 'https://whowatch.tv/profile/%s' % u... | `upload_date` will be automatically calculated from `timestamp`
```suggestion
'timestamp': timestamp,
```
|
# This contains the same formats as the above manifests and is used only as a fallback
formats.extend(self._extract_m3u8_formats(
hls_url, video_id, ext='mp4', entry_protocol='m3u8',
m3u8_id='hls'))
self._remove_duplicate_formats(formats)
self._sort_formats(forma... | @@ -67,18 +73,28 @@ def _real_extract(self, url):
self._sort_formats(formats)
- uploader_id = try_get(metadata, lambda x: x['live']['user']['user_path'], compat_str)
- uploader_id_internal = try_get(metadata, lambda x: x['live']['user']['id'], int)
+ uploader_url = try_get(metadata, la... | yt_dlp/extractor/whowatch.py | 26 | Python | 1 | suggestion | 124 | 31 | 32 | false | [whowatch] add support for whowatch.tv (closes #223) | 292 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc',
'only_matching': True,
}]
_GEO_BYPASS = False
def _get_bearer_token(self, video_id):
_authdata = self._get_login_info()
_time = datetime.now()
_a... | split long line
```suggestion
_video_url = self._download_json(
data.get('playbackApiEndpoint'), content_id, 'Downloading video JSON',
headers={'Authorization': _token}).get('source')
``` | }
}, {
'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc',
'only_matching': True,
}]
_GEO_BYPASS = False
_AUS_AGES = {
'G': 0,
'PG': 15,
'M': 15,
'MA': 15,
'R': 18,
... | @@ -1,70 +1,76 @@
# coding: utf-8
from __future__ import unicode_literals
-
+from datetime import datetime
+import base64
from .common import InfoExtractor
from ..utils import (
HEADRequest,
parse_age_limit,
- parse_iso8601,
- # smuggle_url,
+ urlencode_postdata,
)
class TenPlayIE(InfoExtra... | yt_dlp/extractor/tenplay.py | 26 | Python | 1 | security | 226 | 46 | 51 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
'info_dict': {
'id': 'tpv200928zskgi',
'ext': 'mp4',
'title': "Todd Sampson's Body Hack - S4 Ep. 2",
'description': 'md5:a73ea55671034c6367784405423ef5a0',
'age_limit': 15,
'timestamp': 1601379660,
'upload_date': '20200909',
... | ```suggestion
username, password = self._get_login_info()
_time = datetime.now()
_auth_header = base64.b64encode(f'{_time.year}{"{:02d}".format(_time.month)}{"{:02d}".format(_time.day)}000000'.encode('ascii')).decode('ascii')
if username is None or password is None:
self... | 'url': 'https://10play.com.au/todd-sampsons-body-hack/episodes/season-4/episode-7/tpv200921kvngh',
'info_dict': {
'id': '6192880312001',
'ext': 'mp4',
'title': "Todd Sampson's Body Hack - S4 Ep. 2",
'description': 'md5:fa278820ad90f08ea187f9458316ac74',
... | @@ -1,70 +1,76 @@
# coding: utf-8
from __future__ import unicode_literals
-
+from datetime import datetime
+import base64
from .common import InfoExtractor
from ..utils import (
HEADRequest,
parse_age_limit,
- parse_iso8601,
- # smuggle_url,
+ urlencode_postdata,
)
class TenPlayIE(InfoExtra... | yt_dlp/extractor/tenplay.py | 26 | Python | 1 | security | 429 | 51 | 51 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
from __future__ import unicode_literals
from datetime import datetime
import base64
from .common import InfoExtractor
from ..utils import (
HEADRequest,
parse_age_limit,
urlencode_postdata,
)
class TenPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?10play\.com\.au/(?:[^/]+/)+(?P<id>tpv\d{6}[a... | Don't change test without good reason. Add as a new test case if needed. Also, the `id` of videos must be same as before so as not to break `--download-archive` | from __future__ import unicode_literals
from datetime import datetime
import base64
from .common import InfoExtractor
from ..utils import (
HEADRequest,
urlencode_postdata,
)
class TenPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?10play\.com\.au/(?:[^/]+/)+(?P<id>tpv\d{6}[a-z]{5})'
_NETRC... | @@ -1,70 +1,76 @@
# coding: utf-8
from __future__ import unicode_literals
-
+from datetime import datetime
+import base64
from .common import InfoExtractor
from ..utils import (
HEADRequest,
parse_age_limit,
- parse_iso8601,
- # smuggle_url,
+ urlencode_postdata,
)
class TenPlayIE(InfoExtra... | yt_dlp/extractor/tenplay.py | 26 | Python | 0.714 | suggestion | 160 | 51 | 51 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
# coding: utf-8
from __future__ import unicode_literals
from datetime import datetime
import base64
from .common import InfoExtractor
from ..utils import (
HEADRequest,
parse_age_limit,
urlencode_postdata,
)
class TenPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?10play\.com\.au/(?:[^/]+/)+(... | ```suggestion
from datetime import datetime
import base64
```
seperate into groups | # coding: utf-8
from __future__ import unicode_literals
from datetime import datetime
import base64
from .common import InfoExtractor
from ..utils import (
HEADRequest,
urlencode_postdata,
)
class TenPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?10play\.com\.au/(?:[^/]+/)+(?P<id>tpv\d{6}[a-z]... | @@ -1,70 +1,76 @@
# coding: utf-8
from __future__ import unicode_literals
-
+from datetime import datetime
+import base64 | yt_dlp/extractor/tenplay.py | 5 | Python | 0.857 | suggestion | 92 | 30 | 30 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
'info_dict': {
'id': 'tpv200928zskgi',
'ext': 'mp4',
'title': "Todd Sampson's Body Hack - S4 Ep. 2",
'description': 'md5:a73ea55671034c6367784405423ef5a0',
'age_limit': 15,
'timestamp': 1601379660,
'upload_date': '20200909',
... | can be simplified to:
```suggestion
if username is None or password is None:
self.raise_login_required('Your 10play account\'s details must be provided with --username and --password.')
_timestamp = datetime.now().strftime('%Y%M%d000000')
_auth_header = base64.b64encode(_timesta... | 'id': '6192880312001',
'ext': 'mp4',
'title': "Todd Sampson's Body Hack - S4 Ep. 2",
'description': 'md5:fa278820ad90f08ea187f9458316ac74',
'age_limit': 15,
'timestamp': 1600770600,
'upload_date': '20200922',
'uploader': 'Ch... | @@ -35,26 +37,28 @@ class TenPlayIE(InfoExtractor):
_GEO_BYPASS = False
def _get_bearer_token(self, video_id):
- _authdata = self._get_login_info()
- _time = datetime.now()
- _auth_header = base64.b64encode(f'{_time.year}{"{:02d}".format(_time.month)}{"{:02d}".format(_time.day)}000000'.... | yt_dlp/extractor/tenplay.py | 26 | Python | 1 | security | 360 | 51 | 51 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
content_id = self._match_id(url)
_token = self._get_bearer_token(content_id)
data = self._download_json(
'https://10play.com.au/api/v1/videos/' + content_id, content_id)
_video_url = self._download_json(
data.get('playbackApiEndpoint'), content_id, 'Downloading vi... | ```suggestion
'uploader_id': '2199827728001',
```
typo | 'X-Network-Ten-Auth': _auth_header,
}, data=urlencode_postdata({
'email': username,
'password': password,
}))
return "Bearer " + data['jwt']['accessToken']
def _real_extract(self, url):
content_id = self._match_id(url)
_token = self._get_b... | @@ -1,70 +1,81 @@
# coding: utf-8
from __future__ import unicode_literals
+from datetime import datetime
+import base64
+
from .common import InfoExtractor
from ..utils import (
HEADRequest,
parse_age_limit,
- parse_iso8601,
- # smuggle_url,
+ urlencode_postdata,
)
class TenPlayIE(InfoExt... | yt_dlp/extractor/tenplay.py | 26 | Python | 0.857 | suggestion | 69 | 28 | 36 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
data = self._download_json('https://10play.com.au/api/user/auth', video_id, 'Getting bearer token', headers={
'X-Network-Ten-Auth': _auth_header,
}, data=urlencode_postdata({
'email': username,
'password': password,
}))
return "Bearer " + data['jwt']['... | ```suggestion
'id': data.get('altId') or video_id,
``` | 'X-Network-Ten-Auth': _auth_header,
}, data=urlencode_postdata({
'email': username,
'password': password,
}))
return "Bearer " + data['jwt']['accessToken']
def _real_extract(self, url):
content_id = self._match_id(url)
_token = self._get_b... | @@ -75,7 +77,7 @@ def _real_extract(self, url):
return {
'formats': formats,
- 'id': content_id,
+ 'id': data.get('altId'), | yt_dlp/extractor/tenplay.py | 26 | Python | 0.857 | suggestion | 68 | 37 | 36 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
data = self._download_json('https://10play.com.au/api/user/auth', video_id, 'Getting bearer token', headers={
'X-Network-Ten-Auth': _auth_header,
}, data=urlencode_postdata({
'email': username,
'password': password,
}))
return "Bearer " + data['jwt']['... | ```suggestion
'id': data.get('altId') or content_id,
``` | data = self._download_json('https://10play.com.au/api/user/auth', video_id, 'Getting bearer token', headers={
'X-Network-Ten-Auth': _auth_header,
}, data=urlencode_postdata({
'email': username,
'password': password,
}))
return "Bearer " + data['jwt']['... | @@ -1,70 +1,89 @@
# coding: utf-8
from __future__ import unicode_literals
+from datetime import datetime
+import base64
+
from .common import InfoExtractor
from ..utils import (
HEADRequest,
- parse_age_limit,
- parse_iso8601,
- # smuggle_url,
+ urlencode_postdata,
)
class TenPlayIE(InfoExt... | yt_dlp/extractor/tenplay.py | 26 | Python | 0.857 | suggestion | 70 | 37 | 37 | false | Tenplay update | 314 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
'only_matching': True,
}]
_API_URL = 'https://parlview.aph.gov.au/api_v3/1/playback/getUniversalPlayerConfig?videoID=%s&format=json'
_MEDIA_INFO_URL = 'https://parlview.aph.gov.au/ajaxPlayer.php?videoID=%s&tabNum=4&action=loadTab'
def _real_extract(self, url):
vod_id = self._match_id(ur... | use `unified_timestamp` (add the time format to `utils.date_formats` if needed)
Also, use `try_get` instaed of `.get(...).get...` | 'url': 'https://parlview.aph.gov.au/mediaPlayer.php?videoID=539936',
'only_matching': True,
}]
_API_URL = 'https://parlview.aph.gov.au/api_v3/1/playback/getUniversalPlayerConfig?videoID=%s&format=json'
_MEDIA_INFO_URL = 'https://parlview.aph.gov.au/ajaxPlayer.php?videoID=%s&tabNum=4&action=l... | @@ -0,0 +1,74 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import time
+from datetime import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ HEADRequest,
+)
+
+
+class ParlviewIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?parlview\.aph\.gov\.au/(?:[^/]+)?(video... | yt_dlp/extractor/parlview.py | 26 | Python | 0.714 | style | 130 | 44 | 38 | false | [parlview] add Australian Parliament VOD extractor | 322 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
self.raise_no_formats('No streams were detected')
_stream = _media.get('renditions')[0]
if(_stream.get('streamType') != 'VOD'):
self.raise_no_formats('Unknown type of stream was detected: "%s"' % str(_stream.get('streamType')))
m3u8_url = self._request_webpage(HEADReque... | ```suggestion
'description': self._search_regex(
r'<div[^>]+class="descripti?on"[^>]*>[^>]+<strong>[^>]+>[^>]+>([^<]+)',
_html, 'description').strip(),
``` | stream = try_get(media, lambda x: x['renditions'][0], dict)
if not stream:
self.raise_no_formats('No streams were detected')
elif stream.get('streamType') != 'VOD':
self.raise_no_formats('Unknown type of stream was detected: "%s"' % str(stream.get('streamType')))
... | @@ -0,0 +1,74 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import time
+from datetime import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ HEADRequest,
+)
+
+
+class ParlviewIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?parlview\.aph\.gov\.au/(?:[^/]+)?(video... | yt_dlp/extractor/parlview.py | 26 | Python | 1 | suggestion | 203 | 32 | 26 | false | [parlview] add Australian Parliament VOD extractor | 322 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
if(_stream.get('streamType') != 'VOD'):
self.raise_no_formats('Unknown type of stream was detected: "%s"' % str(_stream.get('streamType')))
m3u8_url = self._request_webpage(HEADRequest(
_stream.get('url')), vod_id, 'Processing m3u8').geturl()
formats = self._extract_m3u8... | download the webpage before `return` (and add a note) | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
try_get,
unified_timestamp,
)
class ParlviewIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?parlview\.aph\.gov\.au/(?:[^/]+)?\bvideoID=(?P... | @@ -0,0 +1,74 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import time
+from datetime import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ HEADRequest,
+)
+
+
+class ParlviewIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?parlview\.aph\.gov\.au/(?:[^/]+)?(video... | yt_dlp/extractor/parlview.py | 26 | Python | 0.357 | suggestion | 53 | 29 | 69 | false | [parlview] add Australian Parliament VOD extractor | 322 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
class AudiusProfileIE(AudiusPlaylistIE):
_VALID_URL = r'https://audius.co/(?P<id>[\w\d-]+)'
_BASE = 'https://discovery-a.mainnet.audius.radar.tech/v1/full/'
_TEST = {
'url': 'https://audius.co/pzl/',
'info_dict': {
'id': 'ezRo7',
'description': 'TAMALE\n\nContact: o... | it looks like `limit` is actually unnecessary |
class AudiusProfileIE(AudiusPlaylistIE):
IE_NAME = 'audius:artist'
IE_DESC = 'Audius.co profile/artist pages'
_VALID_URL = r'https?://(?:www)?audius\.co/(?P<id>[^\/]+)/?(?:[?#]|$)'
_TEST = {
'url': 'https://audius.co/pzl/',
'info_dict': {
'id': 'ezRo7',
'descrip... | @@ -245,3 +245,30 @@ def _real_extract(self, url):
return self.playlist_result(entries, playlist_id,
playlist_data.get('playlist_name', title),
playlist_data.get('description'))
+
+
+class AudiusProfileIE(AudiusPlaylistIE):
+ _VALID_U... | yt_dlp/extractor/audius.py | 26 | Python | 0.286 | suggestion | 45 | 28 | 29 | false | [audius] add support for profile pages | 323 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
raise ExtractorError('Unexpected API response')
playlist_data = playlist_response[0]
if not isinstance(playlist_data, dict):
raise ExtractorError('Unexpected API response')
playlist_id = playlist_data.get('id')
if playlist_id is None:
raise Extractor... | I dont see this being used anywhere | raise ExtractorError('Unexpected API response')
playlist_data = playlist_response[0]
if not isinstance(playlist_data, dict):
raise ExtractorError('Unexpected API response')
playlist_id = playlist_data.get('id')
if playlist_id is None:
raise Extractor... | @@ -245,3 +245,30 @@ def _real_extract(self, url):
return self.playlist_result(entries, playlist_id,
playlist_data.get('playlist_name', title),
playlist_data.get('description'))
+
+
+class AudiusProfileIE(AudiusPlaylistIE):
+ _VALID_U... | yt_dlp/extractor/audius.py | 26 | Python | 0.286 | suggestion | 35 | 49 | 50 | false | [audius] add support for profile pages | 323 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
class AudiusProfileIE(AudiusPlaylistIE):
_VALID_URL = r'https://audius.co/(?P<id>[\w\d-]+)'
_BASE = 'https://discovery-a.mainnet.audius.radar.tech/v1/full/'
_TEST = {
'url': 'https://audius.co/pzl/',
'info_dict': {
'id': 'ezRo7',
'description': 'TAMALE\n\nContact: of... | ```suggestion
return self.playlist_result(self._build_playlist(_api_call), _id, profile_id, _description)
``` |
class AudiusProfileIE(AudiusPlaylistIE):
IE_NAME = 'audius:artist'
IE_DESC = 'Audius.co profile/artist pages'
_VALID_URL = r'https?://(?:www)?audius\.co/(?P<id>[^\/]+)/?(?:[?#]|$)'
_TEST = {
'url': 'https://audius.co/pzl/',
'info_dict': {
'id': 'ezRo7',
'descript... | @@ -245,3 +245,30 @@ def _real_extract(self, url):
return self.playlist_result(entries, playlist_id,
playlist_data.get('playlist_name', title),
playlist_data.get('description'))
+
+
+class AudiusProfileIE(AudiusPlaylistIE):
+ _VALID_U... | yt_dlp/extractor/audius.py | 26 | Python | 1 | suggestion | 119 | 27 | 28 | false | [audius] add support for profile pages | 323 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
if not isinstance(playlist_response, list) or len(playlist_response) != 1:
raise ExtractorError('Unexpected API response')
playlist_data = playlist_response[0]
if not isinstance(playlist_data, dict):
raise ExtractorError('Unexpected API response')
playlist_id = ... | Add `IE_NAME`, `IE_DESC`.
`_VALID_URL` needs changes. See core test | if not isinstance(playlist_response, list) or len(playlist_response) != 1:
raise ExtractorError('Unexpected API response')
playlist_data = playlist_response[0]
if not isinstance(playlist_data, dict):
raise ExtractorError('Unexpected API response')
playlist_id = ... | @@ -245,3 +245,30 @@ def _real_extract(self, url):
return self.playlist_result(entries, playlist_id,
playlist_data.get('playlist_name', title),
playlist_data.get('description'))
+
+
+class AudiusProfileIE(AudiusPlaylistIE):
+ _VALID_U... | yt_dlp/extractor/audius.py | 26 | Python | 0.571 | suggestion | 68 | 50 | 51 | false | [audius] add support for profile pages | 323 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
playlist_data = playlist_response[0]
if not isinstance(playlist_data, dict):
raise ExtractorError('Unexpected API response')
playlist_id = playlist_data.get('id')
if playlist_id is None:
raise ExtractorError('Unable to get playlist ID')
playlist_tracks ... | ```suggestion
_VALID_URL = r'https?://(?:www)?audius\.co/(?P<id>[^\/]+)/?(?:[?#]|$)'
```
These should also match
```
https://audius.co/pzl
https://audius.co/pzl?par=val
https://audius.co/pzl#something
``` |
playlist_data = playlist_response[0]
if not isinstance(playlist_data, dict):
raise ExtractorError('Unexpected API response')
playlist_id = playlist_data.get('id')
if playlist_id is None:
raise ExtractorError('Unable to get playlist ID')
playlist_tracks ... | @@ -245,3 +245,32 @@ def _real_extract(self, url):
return self.playlist_result(entries, playlist_id,
playlist_data.get('playlist_name', title),
playlist_data.get('description'))
+
+
+class AudiusProfileIE(AudiusPlaylistIE):
+ IE_NAME ... | yt_dlp/extractor/audius.py | 26 | Python | 1 | suggestion | 216 | 50 | 49 | false | [audius] add support for profile pages | 323 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
class AudiusProfileIE(AudiusPlaylistIE):
IE_NAME = 'audius:artist'
IE_DESC = 'Audius.co profile/artist pages'
_VALID_URL = r'https?://(?:www)?audius\.co/(?P<id>[^\/]+)/$'
_TEST = {
'url': 'https://audius.co/pzl/',
'info_dict': {
'id': 'ezRo7',
'description': 'TA... | ```suggestion
try:
_profile_data = self._api_request('/full/users/handle/' + profile_id, profile_id)
except ExtractorError as e:
raise ExtractorError('Could not download profile info; ' + str(e))
profile_audius_id = _profile_data[0]['id']
profile_bio = _prof... |
class AudiusProfileIE(AudiusPlaylistIE):
IE_NAME = 'audius:artist'
IE_DESC = 'Audius.co profile/artist pages'
_VALID_URL = r'https?://(?:www)?audius\.co/(?P<id>[^\/]+)/?(?:[?#]|$)'
_TEST = {
'url': 'https://audius.co/pzl/',
'info_dict': {
'id': 'ezRo7',
'descrip... | @@ -245,3 +245,32 @@ def _real_extract(self, url):
return self.playlist_result(entries, playlist_id,
playlist_data.get('playlist_name', title),
playlist_data.get('description'))
+
+
+class AudiusProfileIE(AudiusPlaylistIE):
+ IE_NAME ... | yt_dlp/extractor/audius.py | 26 | Python | 1 | refactor | 347 | 30 | 29 | false | [audius] add support for profile pages | 323 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
class TelemundoIE(InfoExtractor):
_VALID_URL = r'https?:\/\/(?:www\.)?telemundo\.com\/.+?(?=video)video\/[^\/]+(?P<id>tmvo\d{7})'
_TESTS = [{
'url': 'https://www.telemundo.com/noticias/noticias-telemundo-en-la-noche/empleo/video/esta-aplicacion-gratuita-esta-ayudando-los-latinos-encontrar-trabajo-en-es... | use `self._parse_json`. You also might need to use `transform_source=js_to_json` if you are extracting from js and not json | _VALID_URL = r'https?:\/\/(?:www\.)?telemundo\.com\/.+?video\/[^\/]+(?P<id>tmvo\d{7})'
_TESTS = [{
'url': 'https://www.telemundo.com/noticias/noticias-telemundo-en-la-noche/empleo/video/esta-aplicacion-gratuita-esta-ayudando-los-latinos-encontrar-trabajo-en-estados-unidos-tmvo9829325',
'info_dic... | @@ -0,0 +1,60 @@
+# coding=utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ try_get,
+ HEADRequest,
+ unified_timestamp
+)
+
+
+class TelemundoIE(InfoExtractor):
+
+ _VALID_URL = r'https?:\/\/(?:www\.)?telemundo\.com\/.+?(?=video)vid... | yt_dlp/extractor/telemundo.py | 26 | Python | 0.714 | refactor | 123 | 48 | 46 | false | [telemundo] add extractor (#284) | 327 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
# coding=utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
try_get,
HEADRequest,
unified_timestamp
)
class TelemundoIE(InfoExtractor):
_VALID_URL = r'https?:\/\/(?:www\.)?telemundo\.com\/.+?(?=video)video\/[^\/]+(?P<id>tmvo\d{7})'
_TESTS = [{
... | ```suggestion
try_get,
unified_timestamp,
HEADRequest,
``` | # coding=utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
try_get,
unified_timestamp,
HEADRequest,
)
class TelemundoIE(InfoExtractor):
_VALID_URL = r'https?:\/\/(?:www\.)?telemundo\.com\/.+?video\/[^\/]+(?P<id>tmvo\d{7})'
_TESTS = [{
'... | @@ -0,0 +1,58 @@
+# coding=utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ try_get,
+ HEADRequest,
+ unified_timestamp | yt_dlp/extractor/telemundo.py | 8 | Python | 0.857 | suggestion | 74 | 33 | 33 | false | [telemundo] add extractor (#284) | 327 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | king-millez |
class SonyLIVSeriesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sonyliv\.com/shows/[^/?#&]+-(?P<id>\d{10})$'
_TESTS = [{
'url': 'https://www.sonyliv.com/shows/adaalat-1700000091',
'playlist_mincount': 456,
'info_dict': {
'id': '1700000091',
},
}]
_AP... | ```suggestion
headers['security_token'] = self._download_json(
self._API_SECURITY_URL, video_id=show_id, headers=headers,
note='Downloading security token')['resultObj']
seasons = try_get(
self._download_json(self._API_SHOW_URL.format(show_id), video_id=show_id,... |
class SonyLIVSeriesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sonyliv\.com/shows/[^/?#&]+-(?P<id>\d{10})$'
_TESTS = [{
'url': 'https://www.sonyliv.com/shows/adaalat-1700000091',
'playlist_mincount': 456,
'info_dict': {
'id': '1700000091',
},
}]
_AP... | @@ -107,3 +114,35 @@ def _real_extract(self, url):
'episode_number': int_or_none(metadata.get('episodeNumber')),
'release_year': int_or_none(metadata.get('year')),
}
+
+
+class SonyLIVSeriesIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?sonyliv\.com/shows/[^/?#&]+-(?P<id>\d... | yt_dlp/extractor/sonyliv.py | 26 | Python | 1 | security | 769 | 33 | 39 | false | [SonyLIV] Add SonyLIVSeriesIE. | 331 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'season_number': int_or_none(metadata.get('season')),
'series': metadata.get('title'),
'episode_number': int_or_none(metadata.get('episodeNumber')),
'release_year': int_or_none(metadata.get('year')),
}
class SonyLIVSeriesIE(InfoExtractor):
_VALID_URL = r'htt... | ```suggestion
headers['security_token'] = self._download_json(
``` | 'season_number': int_or_none(metadata.get('season')),
'series': metadata.get('title'),
'episode_number': int_or_none(metadata.get('episodeNumber')),
'release_year': int_or_none(metadata.get('year')),
}
class SonyLIVSeriesIE(InfoExtractor):
_VALID_URL = r'htt... | @@ -107,3 +114,41 @@ def _real_extract(self, url):
'episode_number': int_or_none(metadata.get('episodeNumber')),
'release_year': int_or_none(metadata.get('year')),
}
+
+
+class SonyLIVSeriesIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?sonyliv\.com/shows/[^/?#&]+-(?P<id>\d... | yt_dlp/extractor/sonyliv.py | 26 | Python | 1 | security | 76 | 44 | 44 | false | [SonyLIV] Add SonyLIVSeriesIE. | 331 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
intlist_to_bytes,
)
class ShemarooMeIE(InfoExtractor):
_VALID_URL = r'(?:https?://)(?:www\.)?shemaroome\.com/(?:movies|shows)/(?P<id>\S+)'
_TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',... | ```suggestion
iv = [0] * 16
``` | intlist_to_bytes,
unified_strdate,
url_or_none,
)
class ShemarooMeIE(InfoExtractor):
_VALID_URL = r'(?:https?://)(?:www\.)?shemaroome\.com/(?:movies|shows)/(?P<id>[^?#]+)'
_TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil... | @@ -0,0 +1,55 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..aes import aes_cbc_decrypt
+from ..compat import (
+ compat_b64decode,
+ compat_ord,
+)
+from ..utils import (
+ bytes_to_intlist,
+ intlist_to_bytes,
+)
+
+
+class ShemarooMe... | yt_dlp/extractor/shemaroome.py | 26 | Python | 0.786 | suggestion | 41 | 43 | 51 | false | Add ShemarooMeIE. | 332 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
_TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': 'Dil Hai Tumhaara',
'release_date': '2002-09-06',
'thumbnail': 'https://daex9l847wg3n.cloudfront.net/sh... | ```suggestion
webpage, 'release_date', fatal=False)
``` | class ShemarooMeIE(InfoExtractor):
_VALID_URL = r'(?:https?://)(?:www\.)?shemaroome\.com/(?:movies|shows)/(?P<id>[^?#]+)'
_TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': '... | @@ -0,0 +1,55 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..aes import aes_cbc_decrypt
+from ..compat import (
+ compat_b64decode,
+ compat_ord,
+)
+from ..utils import (
+ bytes_to_intlist,
+ intlist_to_bytes,
+)
+
+
+class ShemarooMe... | yt_dlp/extractor/shemaroome.py | 26 | Python | 1 | suggestion | 104 | 37 | 51 | false | Add ShemarooMeIE. | 332 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': 'Dil Hai Tumhaara',
'release_date': '2002-09-06',
'thumbnail': 'https://daex9l847wg3n.cloudfront.net/shemoutputimages/Dil-Hai-Tumhaara/60599346a609d2faa3000020/large_16_9_1616436538.jpg?16... | ```suggestion
webpage, 'description', fatal=False)
```
default should be `None` | _TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': 'Dil Hai Tumhaara',
'release_date': '20020906',
'thumbnail': 'https://daex9l847wg3n.cloudfront.net/shem... | @@ -0,0 +1,55 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..aes import aes_cbc_decrypt
+from ..compat import (
+ compat_b64decode,
+ compat_ord,
+)
+from ..utils import (
+ bytes_to_intlist,
+ intlist_to_bytes,
+)
+
+
+class ShemarooMe... | yt_dlp/extractor/shemaroome.py | 26 | Python | 1 | suggestion | 128 | 35 | 51 | false | Add ShemarooMeIE. | 332 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
_VALID_URL = r'(?:https?://)(?:www\.)?shemaroome\.com/(?:movies|shows)/(?P<id>\S+)'
_TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': 'Dil Hai Tumhaara',
'releas... | May not improve regex match speed, but this is more shorter: `<span itemprop="uploadDate">(?P<uploaddate>\S+)</span>` |
class ShemarooMeIE(InfoExtractor):
_VALID_URL = r'(?:https?://)(?:www\.)?shemaroome\.com/(?:movies|shows)/(?P<id>[^?#]+)'
_TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': ... | @@ -0,0 +1,55 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..aes import aes_cbc_decrypt
+from ..compat import (
+ compat_b64decode,
+ compat_ord,
+)
+from ..utils import (
+ bytes_to_intlist,
+ intlist_to_bytes,
+)
+
+
+class ShemarooMe... | yt_dlp/extractor/shemaroome.py | 26 | Python | 0.5 | suggestion | 117 | 38 | 51 | false | Add ShemarooMeIE. | 332 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | Ashish0804 |
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': 'Dil Hai Tumhaara',
'release_date': '2002-09-06',
'thumbnail': 'https://daex9l847wg3n.cloudfront.net/shemoutputimages/Dil-Hai-Tumhaara/60599346a609d2faa3000020/large_16_9_1616436538.jpg?16... | here too: `<p class="float-left w-100 app-color1 font-regular">(?P<description>[^<]+)</p>` | _TESTS = [{
'url': 'https://www.shemaroome.com/movies/dil-hai-tumhaara',
'info_dict': {
'id': 'dil-hai-tumhaara',
'ext': 'mp4',
'title': 'Dil Hai Tumhaara',
'release_date': '20020906',
'thumbnail': 'https://daex9l847wg3n.cloudfront.net/shem... | @@ -0,0 +1,55 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..aes import aes_cbc_decrypt
+from ..compat import (
+ compat_b64decode,
+ compat_ord,
+)
+from ..utils import (
+ bytes_to_intlist,
+ intlist_to_bytes,
+)
+
+
+class ShemarooMe... | yt_dlp/extractor/shemaroome.py | 26 | Python | 0.357 | suggestion | 90 | 35 | 51 | false | Add ShemarooMeIE. | 332 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | Ashish0804 |
thumbnail_ext = thumbnail_ext[1:].lower()
if thumbnail_ext != 'webp' and self.is_webp(thumbnail_filename):
self.to_screen('Correcting thumbnail "%s" extension to webp' % thumbnail_filename)
webp_filename = replace_extension(thumbnail_filename, 'webp')
... | ```suggestion
self.to_screen('Converting thumbnail "%s" to %s' % (escaped_thumbnail_filename, ext))
```
Using `ext` as the format name will simply the above code. See my other comment | thumbnail_ext = thumbnail_ext[1:].lower()
if thumbnail_ext != 'webp' and self.is_webp(thumbnail_filename):
self.to_screen('Correcting thumbnail "%s" extension to webp' % thumbnail_filename)
webp_filename = replace_extension(thumbnail_filename, 'webp')
... | @@ -849,24 +849,30 @@ def fixup_webp(self, info, idx=-1):
info['__files_to_move'].pop(thumbnail_filename), 'webp')
def convert_thumbnail(self, thumbnail_filename, ext):
- if ext != 'jpg':
- raise FFmpegPostProcessorError('Only conversion to jpg is currently supported')
+ ... | yt_dlp/postprocessor/ffmpeg.py | 26 | Python | 1 | security | 194 | 51 | 51 | false | Add support for PNG thumbnail conversion and default to it if necessary | 333 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | louie-github |
return b[0:4] == b'RIFF' and b[8:] == b'WEBP'
def fixup_webp(self, info, idx=-1):
thumbnail_filename = info['thumbnails'][idx]['filepath']
_, thumbnail_ext = os.path.splitext(thumbnail_filename)
if thumbnail_ext:
thumbnail_ext = thumbnail_ext[1:].lower()
if t... | We could create properties in `FFmpegThumbnailsConvertorPP` for the supported extensions and options:
```py
_SUPPORTED_FORMATS = {
'png': [],
'jpg': ['-bsf:v', 'mjpeg2jpeg'],
}
SUPPORTED_EXTS = _SUPPORTED_FORMATS.keys()
```
Then, this code can be just:
```py
opts = self._... | return b[0:4] == b'RIFF' and b[8:] == b'WEBP'
def fixup_webp(self, info, idx=-1):
thumbnail_filename = info['thumbnails'][idx]['filepath']
_, thumbnail_ext = os.path.splitext(thumbnail_filename)
if thumbnail_ext:
thumbnail_ext = thumbnail_ext[1:].lower()
if t... | @@ -849,24 +849,30 @@ def fixup_webp(self, info, idx=-1):
info['__files_to_move'].pop(thumbnail_filename), 'webp')
def convert_thumbnail(self, thumbnail_filename, ext):
- if ext != 'jpg':
- raise FFmpegPostProcessorError('Only conversion to jpg is currently supported')
+ ... | yt_dlp/postprocessor/ffmpeg.py | 26 | Python | 1 | style | 689 | 51 | 51 | false | Add support for PNG thumbnail conversion and default to it if necessary | 333 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | louie-github |
content = self._call_api(
'1.5', 'IN/CONTENT/VIDEOURL/VOD/' + video_id, video_id)
if not self.get_param('allow_unplayable_formats') and content.get('isEncrypted'):
raise ExtractorError('This video is DRM protected.', expected=True)
dash_url = content['videoURL']
h... | ```suggestion
subtitles.setdefault(sub.get('subtitleLanguageName', 'ENG'), []).append({
``` | content = self._call_api(
'1.5', 'IN/CONTENT/VIDEOURL/VOD/' + video_id, video_id)
if not self.get_param('allow_unplayable_formats') and content.get('isEncrypted'):
raise ExtractorError('This video is DRM protected.', expected=True)
dash_url = content['videoURL']
h... | @@ -100,7 +100,14 @@ def _real_extract(self, url):
metadata = self._call_api(
'1.6', 'IN/DETAIL/' + video_id, video_id)['containers'][0]['metadata']
title = metadata['episodeTitle']
-
+ subtitles = {}
+ for sub in content.get('subtitle', []):
+ sub_url = sub.get('... | yt_dlp/extractor/sonyliv.py | 26 | Python | 1 | suggestion | 105 | 51 | 51 | false | [SonyLIVIE]Add subtitle support. | 342 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'ext': 'mp4',
'title': '橋本',
'uploader': '橋本',
'thumbnail': 'http://111.171.196.85:8088/1a3933e1-a01a-483b-8931-af15f37f8082/thumb',
'is_live': True,
},
'params': {
# m3u8 download
'skip_download': True,
},
... | Using `%` or `format` is preferred over `+` | 'info_dict': {
'id': '10031795',
'ext': 'mp4',
'title': '橋本',
'uploader': '橋本',
'thumbnail': 'http://111.171.196.85:8088/1a3933e1-a01a-483b-8931-af15f37f8082/thumb',
'is_live': True,
},
'params': {
# m3u8 downloa... | @@ -0,0 +1,83 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class SaitosanIE(InfoExtractor):
+ IE_NAME = 'Saitosan'
+ _VALID_URL = r'https?://(?:www\.)?saitosan\.net/bview.html\?id=(?P<id>[0-9]+)'
+ _TESTS = [{
+ 'url': 'http://www.saitosan.net/bv... | yt_dlp/extractor/saitosan.py | 26 | Python | 0.5 | suggestion | 43 | 51 | 50 | false | [Saitosan] Add new extractor | 350 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'uploader': '橋本',
'thumbnail': 'http://111.171.196.85:8088/1a3933e1-a01a-483b-8931-af15f37f8082/thumb',
'is_live': True,
},
'params': {
# m3u8 download
'skip_download': True,
},
'skip': 'Broadcasts are ephemeral',
}]
de... | ```suggestion
self._download_webpage(base, b_id, data=payload, note='Polling socket with payload')
```
Also use `'` everywhere (unless the string has `'` ofc) for consistency across the whole project | 'ext': 'mp4',
'title': '橋本',
'uploader': '橋本',
'thumbnail': 'http://111.171.196.85:8088/1a3933e1-a01a-483b-8931-af15f37f8082/thumb',
'is_live': True,
},
'params': {
# m3u8 download
'skip_download': True,
},
... | @@ -0,0 +1,83 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class SaitosanIE(InfoExtractor):
+ IE_NAME = 'Saitosan'
+ _VALID_URL = r'https?://(?:www\.)?saitosan\.net/bview.html\?id=(?P<id>[0-9]+)'
+ _TESTS = [{
+ 'url': 'http://www.saitosan.net/bv... | yt_dlp/extractor/saitosan.py | 26 | Python | 1 | suggestion | 212 | 51 | 48 | false | [Saitosan] Add new extractor | 350 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'params': {
# m3u8 download
'skip_download': True,
},
'skip': 'Broadcasts are ephemeral',
}]
def _real_extract(self, url):
b_id = self._match_id(url)
def format_socket_response_as_json(data):
return self._parse_json(data[data.find('{'... | ```suggestion
raise ExtractorError(
'The socket reported that the broadcast could not be joined. Maybe it's offline or the URL is incorrect',
expected=True, video_id=b_id)
```
`raise_no_formats` is for when metadata is available, but download links are not | 'is_live': True,
},
'params': {
# m3u8 download
'skip_download': True,
},
'skip': 'Broadcasts are ephemeral',
}]
def _real_extract(self, url):
b_id = self._match_id(url)
base = 'http://hankachi.saitosan-api.net:8002/socket.io/... | @@ -0,0 +1,83 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class SaitosanIE(InfoExtractor):
+ IE_NAME = 'Saitosan'
+ _VALID_URL = r'https?://(?:www\.)?saitosan\.net/bview.html\?id=(?P<id>[0-9]+)'
+ _TESTS = [{
+ 'url': 'http://www.saitosan.net/bv... | yt_dlp/extractor/saitosan.py | 26 | Python | 1 | bug | 305 | 49 | 44 | false | [Saitosan] Add new extractor | 350 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class SaitosanIE(InfoExtractor):
IE_NAME = 'Saitosan'
_VALID_URL = r'https?://(?:www\.)?saitosan\.net/bview.html\?id=(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://www.saitosan.net/bview.html?id=10031846',
... | It is not necessary to define `IE_NAME` when it is same as the class name. Ofc, no harm in defining it either | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError, try_get
class SaitosanIE(InfoExtractor):
IE_NAME = 'Saitosan'
_VALID_URL = r'https?://(?:www\.)?saitosan\.net/bview.html\?id=(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://ww... | @@ -0,0 +1,83 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class SaitosanIE(InfoExtractor):
+ IE_NAME = 'Saitosan' | yt_dlp/extractor/saitosan.py | 10 | Python | 0.5 | suggestion | 109 | 35 | 35 | false | [Saitosan] Add new extractor | 350 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
# m3u8 download
'skip_download': True,
},
'skip': 'Broadcasts are ephemeral',
}]
def _real_extract(self, url):
b_id = self._match_id(url)
def format_socket_response_as_json(data):
return self._parse_json(data[data.find('{'):data.rfind('}') + ... | ```suggestion
"The socket reported that the broadcast could not be joined. Maybe it's offline or the URL is incorrect",
``` | },
'params': {
# m3u8 download
'skip_download': True,
},
'skip': 'Broadcasts are ephemeral',
}]
def _real_extract(self, url):
b_id = self._match_id(url)
base = 'http://hankachi.saitosan-api.net:8002/socket.io/?transport=polling&EIO=3'
... | @@ -58,7 +58,9 @@ def format_socket_response_as_json(data):
should_continue = format_socket_response_as_json(self._download_webpage(base, b_id, note="Polling socket")).get('ok')
if not should_continue:
# The socket does not give any specific error messages.
- self.raise_no_form... | yt_dlp/extractor/saitosan.py | 26 | Python | 1 | bug | 141 | 50 | 43 | false | [Saitosan] Add new extractor | 350 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'skip': 'Broadcasts are ephemeral',
}]
def _real_extract(self, url):
b_id = self._match_id(url)
def format_socket_response_as_json(data):
return self._parse_json(data[data.find('{'):data.rfind('}') + 1], b_id)
base = 'http://hankachi.saitosan-api.net:8002/socket.io... | Double quotes here but single quotes in the line below... | 'skip_download': True,
},
'skip': 'Broadcasts are ephemeral',
}]
def _real_extract(self, url):
b_id = self._match_id(url)
base = 'http://hankachi.saitosan-api.net:8002/socket.io/?transport=polling&EIO=3'
sid = self._download_socket_json(base, b_id, note='Ope... | @@ -0,0 +1,85 @@
+# coding: utf-8
+from __future__ import unicode_literals
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class SaitosanIE(InfoExtractor):
+ IE_NAME = 'Saitosan'
+ _VALID_URL = r'https?://(?:www\.)?saitosan\.net/bview.html\?id=(?P<id>[0-9]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/saitosan.py | 26 | Python | 0.143 | suggestion | 57 | 47 | 40 | false | [Saitosan] Add new extractor | 350 | yt-dlp/yt-dlp | 132,642 | Python | liamengland1 | liamengland1 |
'id': '10031795',
'ext': 'mp4',
'title': '橋本',
'uploader': '橋本',
'thumbnail': 'http://111.171.196.85:8088/1a3933e1-a01a-483b-8931-af15f37f8082/thumb',
'is_live': True,
},
'params': {
# m3u8 download
'skip_dow... | ```suggestion
payload = '420["room_start_join",{"room_id":"%s"}]' % b_id
``` | 'url': 'http://www.saitosan.net/bview.html?id=10031795',
'info_dict': {
'id': '10031795',
'ext': 'mp4',
'title': '橋本',
'uploader': '橋本',
'thumbnail': 'http://111.171.196.85:8088/1a3933e1-a01a-483b-8931-af15f37f8082/thumb',
'is_live'... | @@ -0,0 +1,85 @@
+# coding: utf-8
+from __future__ import unicode_literals
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class SaitosanIE(InfoExtractor):
+ IE_NAME = 'Saitosan'
+ _VALID_URL = r'https?://(?:www\.)?saitosan\.net/bview.html\?id=(?P<id>[0-9]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/saitosan.py | 26 | Python | 0.857 | suggestion | 86 | 51 | 51 | false | [Saitosan] Add new extractor | 350 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
)
class VootIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
voot:|
(?:https?://)(?:www\.)?voot\.com/?
(?:
movies/[^/]+/|
shows/[^/]+/\d+/\d+/[^/]+/
... | ```suggestion
```
If the key cannot be extracted, remove it from the test | )
class VootIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
voot:|
(?:https?://)(?:www\.)?voot\.com/?
(?:
movies/[^/]+/|
(?:shows|kids)/(?:[^/]+/){4}
... | @@ -22,7 +33,7 @@ class VootIE(InfoExtractor):
'description': 'md5:06291fbbbc4dcbe21235c40c262507c1',
'timestamp': 1472162937,
'upload_date': '20160825',
- 'duration': 1146,
+ 'duration': None, | yt_dlp/extractor/voot.py | 26 | Python | 0.857 | refactor | 77 | 51 | 51 | false | [Voot] Add VootSeriesIE. | 351 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
try_get,
unified_timestamp,
)
class VootIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
... | ```suggestion
(?:shows|kids)/(?:[^/]+/){4}
``` | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
try_get,
unified_timestamp,
)
class VootIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
... | @@ -11,7 +12,17 @@
class VootIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?voot\.com/(?:[^/]+/)+(?P<id>\d+)'
+ _VALID_URL = r'''(?x)
+ (?:
+ voot:|
+ (?:https?://)(?:www\.)?voot\.com/?
+ (?:
+ ... | yt_dlp/extractor/voot.py | 21 | Python | 0.857 | suggestion | 76 | 46 | 46 | false | [Voot] Add VootSeriesIE. | 351 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
class VootIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
voot:|
(?:https?://)(?:www\.)?voot\.com/?
(?:
movies/[^/]+/|
shows/[^/]+/\d+/\d+/[^/]+/
)... | even though this URL no longer works in browser, we have no reason to intentionally break it | class VootIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:
voot:|
(?:https?://)(?:www\.)?voot\.com/?
(?:
movies/[^/]+/|
(?:shows|kids)/(?:[^/]+/){4}
... | @@ -34,17 +44,13 @@ class VootIE(InfoExtractor):
'skip_download': True,
},
'expected_warnings': ['Failed to download m3u8 information'],
- }, {
- 'url': 'https://www.voot.com/kids/characters/mighty-cat-masked-niyander-e-/400478/school-bag-disappears/440925',
- 'only_match... | yt_dlp/extractor/voot.py | 26 | Python | 0.143 | suggestion | 92 | 51 | 51 | false | [Voot] Add VootSeriesIE. | 351 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# If there's only one item, use it as the main info dict
only_video = entries[list(entries.keys())[0]]
if entry_id:
info = merge_dicts(only_video, info)
else:
info = merge_dicts(info, only_video)
else:
# Otherwise, we ha... | should probably be `archive.org:something` (is web.archive.org and www.archive.org different things?) | for entry in entries.values():
entry['formats'] = list(sorted(entry['formats'], key=lambda x: x.get('filesize', -1)))
if len(entries) == 1:
# If there's only one item, use it as the main info dict
only_video = entries[list(entries.keys())[0]]
if entry_id:... | @@ -241,3 +251,87 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org' | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.714 | suggestion | 101 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
info = merge_dicts(only_video, info)
else:
info = merge_dicts(info, only_video)
else:
# Otherwise, we have a playlist.
info['_type'] = 'playlist'
info['entries'] = list(entries.values())
if metadata.get('reviews'):
... | > (?:https?://|//)
why the `|//`? | if len(entries) == 1:
# If there's only one item, use it as the main info dict
only_video = entries[list(entries.keys())[0]]
if entry_id:
info = merge_dicts(only_video, info)
else:
info = merge_dicts(info, only_video)
else:
... | @@ -241,3 +251,87 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org'
+ IE_DESC = 'web.archive.org saved youtube videos'
+ _VALID_URL = r"""(?x)^
+ (?:https?://|//)?we... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.286 | question | 36 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
info['entries'] = list(entries.values())
if metadata.get('reviews'):
info['comments'] = []
for review in metadata['reviews']:
info['comments'].append({
'id': review.get('review_id'),
'author': review.get('reviewer'),
... | You might also want to deal with encoded urls here | info = merge_dicts(info, only_video)
else:
# Otherwise, we have a playlist.
info['_type'] = 'playlist'
info['entries'] = list(entries.values())
if metadata.get('reviews'):
info['comments'] = []
for review in metadata['reviews']... | @@ -241,3 +251,87 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org'
+ IE_DESC = 'web.archive.org saved youtube videos'
+ _VALID_URL = r"""(?x)^
+ (?:https?://|//)?we... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.143 | suggestion | 50 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
}
}
]
def _real_extract(self, url):
video_id = self._match_id(url)
# Use link translator mentioned in https://github.com/ytdl-org/youtube-dl/issues/13655
internal_fake_url = self._INTERNAL_URL_TEMPLATE % video_id
video_file_webpage = self._request_webpage(
... | ```suggestion
'title': id, # We are not able to get a title
``` | 'ext': 'unknown_video',
'title': 'Me at the zoo'
}
},
{
# Flash video with .flv extension (itag 34). Title has prefix "YouTube -"
# Title has some weird unicode characters too.
'url': 'https://web.archive.org/web/201... | @@ -241,3 +251,87 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org'
+ IE_DESC = 'web.archive.org saved youtube videos'
+ _VALID_URL = r"""(?x)^
+ (?:https?://|//)?we... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.857 | suggestion | 78 | 31 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
info = merge_dicts(info, only_video)
else:
# Otherwise, we have a playlist.
info['_type'] = 'playlist'
info['entries'] = list(entries.values())
if metadata.get('reviews'):
info['comments'] = []
for review in metadata['reviews']... | ```suggestion
(?:[0-9A-Za-z_*]+/)? # /web and the version index is optional
```
Flake8 doesnt detect this since it is inside the regex, but use 2 spaces before comments. Similar below | only_video = entries[list(entries.keys())[0]]
if entry_id:
info = merge_dicts(only_video, info)
else:
info = merge_dicts(info, only_video)
else:
# Otherwise, we have a playlist.
info['_type'] = 'playlist'
inf... | @@ -241,3 +251,87 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org'
+ IE_DESC = 'web.archive.org saved youtube videos'
+ _VALID_URL = r"""(?x)^
+ (?:https?://|//)?we... | yt_dlp/extractor/archiveorg.py | 26 | Python | 1 | suggestion | 207 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
'url': 'https://web.archive.org/web/20050214000000/http://www.youtube.com/watch?v=0altSZ96U4M',
'info_dict': {
'id': '0altSZ96U4M',
'ext': 'mp4',
'title': '0altSZ96U4M'
},
'expected_warnings': [
'Unable to ex... | Issue: Sometimes there are more than 1 spaces separating the "-"
https://web.archive.org/web/20110712231407/http://www.youtube.com/watch?v=lTx3G6h2xyA | { # Some versions of Youtube have have "YouTube" as page title in html (and later rewritten by js).
'url': 'https://web.archive.org/web/http://www.youtube.com/watch?v=kH-G_aIBlFw',
'info_dict': {
'id': 'kH-G_aIBlFw',
'ext': 'mp4',
'title'... | @@ -285,38 +285,99 @@ class YoutubeWebArchiveIE(InfoExtractor):
'info_dict': {
'id': '97t7Xj_iBv0',
'ext': 'mp4',
- 'title': '97t7Xj_iBv0'
+ 'title': 'How Flexible Machines Could Save The World'
}
-
},
{
- ... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.286 | suggestion | 151 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
if metadata.get('reviews'):
info['comments'] = []
for review in metadata['reviews']:
info['comments'].append({
'id': review.get('review_id'),
'author': review.get('reviewer'),
'text': str_or_none(review.get('revi... | ```suggestion
(?:https?(?::|%3[Aa])//)?
(?:
(?:\w+\.)?youtube\.com/watch(?:\?|%3[fF])(?:[^\#]+(?:&|%26))?v(?:=|%3[dD]) # Youtube URL
|(wayback-fakeurl\.archive\.org/yt/) # Or the internal fake url
)
(?P<id>... | info['comments'] = []
for review in metadata['reviews']:
info['comments'].append({
'id': review.get('review_id'),
'author': review.get('reviewer'),
'text': str_or_none(review.get('reviewtitle'), '') + '\n\n' + review.get... | @@ -241,3 +256,153 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org'
+ IE_DESC = 'web.archive.org saved youtube videos'
+ _VALID_URL = r"""(?x)^
+ (?:https?://)?web\... | yt_dlp/extractor/archiveorg.py | 26 | Python | 1 | suggestion | 722 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
'ext': 'mp4',
'title': '0altSZ96U4M'
},
'expected_warnings': [
'unable to extract title',
]
},
{
# Video not archived, only capture is unavailable video page
'url': 'https://web.archive.org/web/20... | use `fatal=False` in `_search_regex`. Or maybe just use `re.match`
Also, if prefix/suffix is not found, return the title as-is. Why fall back to id in that case? | 'ext': 'mp4',
'title': '0altSZ96U4M'
},
'expected_warnings': [
'unable to extract title',
]
},
{
# Video not archived, only capture is unavailable video page
'url': 'https://web.archive.org/web/20... | @@ -241,3 +256,153 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org'
+ IE_DESC = 'web.archive.org saved youtube videos'
+ _VALID_URL = r"""(?x)^
+ (?:https?://)?web\... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.714 | question | 164 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
},
{
# First capture is a 302 redirect intermediary page.
'url': 'https://web.archive.org/web/20050214000000/http://www.youtube.com/watch?v=0altSZ96U4M',
'info_dict': {
'id': '0altSZ96U4M',
'ext': 'mp4',
'title': '0altSZ... | You may want to use `_html_search_regex` instead of `strip_or_none(self._search_regex` here | },
{
# First capture is a 302 redirect intermediary page.
'url': 'https://web.archive.org/web/20050214000000/http://www.youtube.com/watch?v=0altSZ96U4M',
'info_dict': {
'id': '0altSZ96U4M',
'ext': 'mp4',
'title': '0altSZ... | @@ -241,3 +256,153 @@ def _real_extract(self, url):
'parent': 'root'})
return info
+
+
+class YoutubeWebArchiveIE(InfoExtractor):
+ IE_NAME = 'youtube:web.archive.org'
+ IE_DESC = 'web.archive.org saved youtube videos'
+ _VALID_URL = r"""(?x)^
+ (?:https?://)?web\... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.571 | suggestion | 91 | 51 | 51 | false | [archiveorg] Add basic support for saved YouTube videos on the Wayback Machine | 356 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
'only_matching': True
}]
def _real_initialize(self):
self._api_key = self._download_json(
'https://www.vidio.com/auth', None, data=b'')['api_key']
def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
data = self._download_... | ```suggestion
self.raise_login_required(method='cookies')
```
I had added an optional argument `method` to show a more usefull error message to user based on whether cookies or user-pass is the accepted auth method | 'only_matching': True
}]
def _real_initialize(self):
self._api_key = self._download_json(
'https://www.vidio.com/auth', None, data=b'')['api_key']
def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
data = self._download_... | @@ -56,9 +60,28 @@ def _real_extract(self, url):
})
video = data['videos'][0]
title = video['title'].strip()
+ hls_url = data['clips'][0]['hls_url']
+
+ formats, subs = self._extract_m3u8_formats_and_subtitles(
+ hls_url, display_id, 'mp4', 'm3u8_native', errnote=... | yt_dlp/extractor/vidio.py | 26 | Python | 1 | security | 235 | 51 | 51 | false | [vidio] Add support for premier-exclusive videos | 358 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
data = self._download_json(
'https://api.vidio.com/videos/' + video_id, display_id, headers={
'Content-Type': 'application/vnd.api+json',
'X-API-KEY': self._api_ke... | ```suggestion
if sources.get('source_dash'): # TODO: Find video example with source_dash
```
> can both exist at the same time?
The code can already handle either case, so no need to put that in todo | def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
data = self._download_json(
'https://api.vidio.com/videos/' + video_id, display_id, headers={
'Content-Type': 'application/vnd.api+json',
'X-API-KEY': self._api_ke... | @@ -56,9 +60,28 @@ def _real_extract(self, url):
})
video = data['videos'][0]
title = video['title'].strip()
+ hls_url = data['clips'][0]['hls_url']
+
+ formats, subs = self._extract_m3u8_formats_and_subtitles(
+ hls_url, display_id, 'mp4', 'm3u8_native', errnote=... | yt_dlp/extractor/vidio.py | 26 | Python | 1 | suggestion | 218 | 51 | 51 | false | [vidio] Add support for premier-exclusive videos | 358 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'comment_count': int,
'tags': 'count:4',
},
}, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1... | is this key guaranteed to be present even for premium videos? If not, use `try_get` | 'comment_count': int,
'tags': 'count:4',
},
}, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1... | @@ -56,9 +60,28 @@ def _real_extract(self, url):
})
video = data['videos'][0]
title = video['title'].strip()
+ hls_url = data['clips'][0]['hls_url'] | yt_dlp/extractor/vidio.py | 26 | Python | 0.571 | question | 83 | 51 | 51 | false | [vidio] Add support for premier-exclusive videos | 358 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'comment_count': int,
'tags': 'count:4',
},
}, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1... | ```suggestion
is_premium = video.get('is_premium')
``` | 'comment_count': int,
'tags': 'count:4',
},
}, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1... | @@ -60,27 +60,29 @@ def _real_extract(self, url):
})
video = data['videos'][0]
title = video['title'].strip()
- hls_url = data['clips'][0]['hls_url']
-
- formats, subs = self._extract_m3u8_formats_and_subtitles(
- hls_url, display_id, 'mp4', 'm3u8_native', errnote... | yt_dlp/extractor/vidio.py | 26 | Python | 0.857 | suggestion | 64 | 51 | 51 | false | [vidio] Add support for premier-exclusive videos | 358 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1550718-stand-by-me-doraemon',
'only_matching': True
}]
def _real_ini... | ```suggestion
sources = self._download_json(
'https://www.vidio.com/interactions_stream.json?video_id=%s&type=videos' % video_id,
display_id, note='Downloading premium API JSON')
```
Feel free to change the actual `note` to whatever you want | 'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1550718-stand-by-me-doraemon',
'only_matching': True
}]
def _real_ini... | @@ -56,9 +60,30 @@ def _real_extract(self, url):
})
video = data['videos'][0]
title = video['title'].strip()
+ is_premium = video['is_premium']
+ if is_premium:
+ self.to_screen('Premier-exclusive video detected, switching to premier mode')
+ sources = ... | yt_dlp/extractor/vidio.py | 26 | Python | 1 | suggestion | 292 | 51 | 51 | false | [vidio] Add support for premier-exclusive videos | 358 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
},
}, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1550718-stand-by-me-doraemon',
'only_matching': True
}... | ```suggestion
sources = self._download_json(
``` | },
}, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1550718-stand-by-me-doraemon',
'only_matching': True
}... | @@ -56,9 +60,30 @@ def _real_extract(self, url):
})
video = data['videos'][0]
title = video['title'].strip()
+ is_premium = video.get('is_premium')
+ if is_premium:
+ sources = sources = self._download_json( | yt_dlp/extractor/vidio.py | 26 | Python | 0.857 | suggestion | 62 | 51 | 51 | false | [vidio] Add support for premier-exclusive videos | 358 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
}, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1550718-stand-by-me-doraemon',
'only_matching': True
}]
_LOGI... | ```suggestion
def is_logged_in():
resp = self._download_json(
'https://www.vidio.com/interactions.json', None, 'Checking if logged in', fatal=False) or {}
return bool(resp.get('current_user'))
if is_logged_in():
return
``` | }, {
'url': 'https://www.vidio.com/watch/77949-south-korea-test-fires-missile-that-can-strike-all-of-the-north',
'only_matching': True,
}, {
# Premier-exclusive video
'url': 'https://www.vidio.com/watch/1550718-stand-by-me-doraemon',
'only_matching': True
}]
_LOGI... | @@ -46,10 +49,44 @@ class VidioIE(InfoExtractor):
'url': 'https://www.vidio.com/watch/1550718-stand-by-me-doraemon',
'only_matching': True
}]
+ _LOGIN_URL = 'https://www.vidio.com/users/login'
+ _NETRC_MACHINE = 'vidio'
+
+ def _login(self):
+ username, password = self._get_login_... | yt_dlp/extractor/vidio.py | 26 | Python | 1 | suggestion | 299 | 51 | 51 | false | [vidio] Add login support | 362 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
class HotStarSeriesIE(HotStarBaseIE):
IE_NAME = 'hotstar:series'
_VALID_URL = r'(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d{10})$'
_TESTS = [{
'url': 'https://www.hotstar.com/in/tv/radhakrishn/1260000646',
'info_dict': {
'id': '1260000646',
},
... | ```suggestion
id = detail_json['body']['results']['item']['id']
item_json = self._download_json('https://api.hotstar.com/o/v1/tray/g/1/items?etid=0&tao=0&tas=10000&eid=%d' % id,
``` | IE_NAME = 'hotstar:series'
_VALID_URL = r'(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d{10})$'
_TESTS = [{
'url': 'https://www.hotstar.com/in/tv/radhakrishn/1260000646',
'info_dict': {
'id': '1260000646',
},
'playlist_mincount': 690,
}, {
... | @@ -235,3 +245,41 @@ def _real_extract(self, url):
if video.get('contentId')]
return self.playlist_result(entries, playlist_id)
+
+
+class HotStarSeriesIE(HotStarBaseIE):
+ IE_NAME = 'hotstar:series'
+ _VALID_URL = r'(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d{10})$'
+ ... | yt_dlp/extractor/hotstar.py | 26 | Python | 1 | suggestion | 200 | 39 | 36 | false | [Hotstar] Add HotStarSeriesIE. | 366 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
if video.get('contentId')]
return self.playlist_result(entries, playlist_id)
class HotStarSeriesIE(HotStarBaseIE):
IE_NAME = 'hotstar:series'
_VALID_URL = r'(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d{10})$'
_TESTS = [{
'url': 'https://www.hotstar.com/in/tv/... | ~~why not use `self._call_api`?~~
nvm, I see call_api is different |
class HotStarSeriesIE(HotStarBaseIE):
IE_NAME = 'hotstar:series'
_VALID_URL = r'(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d{10})$'
_TESTS = [{
'url': 'https://www.hotstar.com/in/tv/radhakrishn/1260000646',
'info_dict': {
'id': '1260000646',
},
... | @@ -235,3 +245,41 @@ def _real_extract(self, url):
if video.get('contentId')]
return self.playlist_result(entries, playlist_id)
+
+
+class HotStarSeriesIE(HotStarBaseIE):
+ IE_NAME = 'hotstar:series'
+ _VALID_URL = r'(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d{10})$'
+ ... | yt_dlp/extractor/hotstar.py | 26 | Python | 0.571 | suggestion | 69 | 42 | 39 | false | [Hotstar] Add HotStarSeriesIE. | 366 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'uploader_id': 'sctv',
'thumbnail': r're:^https?://.*\.jpg$',
},
}, {
# Premier-exclusive livestream
'url': 'https://www.vidio.com/live/6362-tvn',
'only_matching': True,
}, {
# DRM premier-exclusive livestream
'url': 'https://www.vidio.com/... | if the format doesn't actually have drm, no reason to block it irrespective of what the manifest says | 'uploader': 'SCTV',
'uploader_id': 'sctv',
'thumbnail': r're:^https?://.*\.jpg$',
},
}, {
# Premier-exclusive livestream
'url': 'https://www.vidio.com/live/6362-tvn',
'only_matching': True,
}, {
# DRM premier-exclusive livestream
... | @@ -150,3 +158,134 @@ def _real_extract(self, url):
'comment_count': get_count('comments'),
'tags': video.get('tag_list'),
}
+
+
+class VidioPremierIE(VidioBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?vidio\.com/premier/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/vidio.py | 26 | Python | 0.286 | style | 101 | 51 | 51 | false | [vidio] Add VidioPremierIE and VidioLiveIE | 371 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.