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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'timestamp': 1620331399,
'upload_date': '20210506',
},
},
{
'url': 'https://us.bbcollab.com/collab/ui/session/playback/load/76761522adfe4345a0dee6794bbcabda',
'only_matching': True,
},
{
'url': 'https://ca.bb... | change this to
`region, video_id = re.match(self._VALID_URL, url).groups()` | 'timestamp': 1620331399,
'upload_date': '20210506',
},
},
{
'url': 'https://us.bbcollab.com/collab/ui/session/playback/load/76761522adfe4345a0dee6794bbcabda',
'only_matching': True,
},
{
'url': 'https://ca.bb... | @@ -0,0 +1,68 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..utils import parse_iso8601
+
+
+class BlackboardCollaborateIE(InfoExtractor):
+ _VALID_URL = r'''(?x)
+ https?://
+ (?P<region>[a-z-]+)\.b... | yt_dlp/extractor/blackboardcollaborate.py | 26 | Python | 0.571 | suggestion | 77 | 42 | 42 | false | [blackboardcollaborate] Add new extractor | 646 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | mezbaul-h |
{
'url': 'https://us.bbcollab.com/collab/ui/session/playback/load/76761522adfe4345a0dee6794bbcabda',
'only_matching': True,
},
{
'url': 'https://ca.bbcollab.com/collab/ui/session/playback/load/b6399dcb44df4f21b29ebe581e22479d',
'only_matching': Tru... | Don't use `.get` here imo, it will return `None` if the title is not present and title can't be None.
Better to use `title = info['name']` so in case it's missing, an error is thrown here.
| {
'url': 'https://us.bbcollab.com/collab/ui/session/playback/load/76761522adfe4345a0dee6794bbcabda',
'only_matching': True,
},
{
'url': 'https://ca.bbcollab.com/collab/ui/session/playback/load/b6399dcb44df4f21b29ebe581e22479d',
'only_matching': Tru... | @@ -0,0 +1,68 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..utils import parse_iso8601
+
+
+class BlackboardCollaborateIE(InfoExtractor):
+ _VALID_URL = r'''(?x)
+ https?://
+ (?P<region>[a-z-]+)\.b... | yt_dlp/extractor/blackboardcollaborate.py | 26 | Python | 1 | suggestion | 191 | 38 | 38 | false | [blackboardcollaborate] Add new extractor | 646 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | mezbaul-h |
class MirrativIE(MirrativBaseIE):
IE_NAME = 'mirrativ'
_VALID_URL = r'https?://(?:www\.)?mirrativ\.com/live/(?P<id>[^/?#&]+)'
LIVE_API_URL = 'https://www.mirrativ.com/api/live/live?live_id=%s'
TESTS = [{
'url': 'https://mirrativ.com/live/POxyuG1KmW2982lqlDTuPw',
'only_matching': True,
... | Any reason why this is being forced to use ffmpeg? | raise ExtractorError('Mirrativ says: %s' % error_message, expected=True)
class MirrativIE(MirrativBaseIE):
IE_NAME = 'mirrativ'
_VALID_URL = r'https?://(?:www\.)?mirrativ\.com/live/(?P<id>[^/?#&]+)'
LIVE_API_URL = 'https://www.mirrativ.com/api/live/live?live_id=%s'
TESTS = [{
'url... | @@ -0,0 +1,133 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ traverse_obj,
+)
+
+
+class MirrativBaseIE(InfoExtractor):
+ def assert_error(self, response):
+ error_message = traverse_obj(response, ('status', 'error'))
+ ... | yt_dlp/extractor/mirrativ.py | 26 | Python | 0.357 | question | 50 | 51 | 51 | false | [mirrativ] add support for mirrativ.com | 657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
note='Downloading user info', fatal=False)
self.assert_error(user_info)
uploader = user_info.get('name')
description = user_info.get('description')
entries = []
page = 1
while page is not None:
api_response = self._download_json(
... | entries should be yielded so that `--playlist-end` may work correctly
The common way this is done is:
```py
def _entries(self, user_id):
page = 1
while page:
...
for ...:
yield self.url_result(...)
page = ...
def _real_extract(self... | api_response = self._download_json(
self.LIVE_HISTORY_API_URL % (user_id, page), user_id,
note='Downloading page %d' % page)
self.assert_error(api_response)
lives = api_response.get('lives')
if not lives:
break
f... | @@ -0,0 +1,133 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ traverse_obj,
+)
+
+
+class MirrativBaseIE(InfoExtractor):
+ def assert_error(self, response):
+ error_message = traverse_obj(response, ('status', 'error'))
+ ... | yt_dlp/extractor/mirrativ.py | 26 | Python | 1 | refactor | 543 | 29 | 30 | false | [mirrativ] add support for mirrativ.com | 657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
m = re.search(r'You must be logged in to view this video\.', webpage)
if m:
self.raise_login_required('This video requires login')
video_id = self._search_regex(
[r"glbUpdViews\s*\('\d*','(\d+)'", r'p/report/video/(\d+)'],
webpage, 'video id', default=None)
... | ```suggestion
```
since you aren't logging in |
m = re.search(r'You must be logged in to view this video\.', webpage)
if m:
self.raise_login_required('This video requires login')
video_id = self._search_regex(
[r"glbUpdViews\s*\('\d*','(\d+)'", r'p/report/video/(\d+)'],
webpage, 'video id', default=None)
... | @@ -90,3 +90,48 @@ def _real_extract(self, url):
'title': title,
'age_limit': 18,
})
+
+
+class EroProfileAlbumIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/album/(?P<id>[^/]+)'
+ _NETRC_MACHINE = 'eroprofile' | yt_dlp/extractor/eroprofile.py | 26 | Python | 0.786 | suggestion | 47 | 51 | 51 | false | [eroprofile] Add album downloader | 658 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | jhwgh1968 |
]
def _real_extract(self, url):
playlist_id = self._match_id(url)
playlist_pages = []
playlist_pages.append(self._download_webpage(url, playlist_id,
note='Downloading playlist page 1'))
playlist_title = self._search_regex(
... | Use `InAdvancePagedList` if the number of items in a page is known in advance, else yield the videos
See https://github.com/yt-dlp/yt-dlp/pull/657#discussion_r685516029 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
ExtractorError,
merge_dicts,
)
class EroProfileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
... | @@ -90,3 +90,48 @@ def _real_extract(self, url):
'title': title,
'age_limit': 18,
})
+
+
+class EroProfileAlbumIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/album/(?P<id>[^/]+)'
+ _NETRC_MACHINE = 'eroprofile'
+ IE_NAME = 'EroProfile:album'
+... | yt_dlp/extractor/eroprofile.py | 26 | Python | 0.714 | suggestion | 171 | 31 | 130 | false | [eroprofile] Add album downloader | 658 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | jhwgh1968 |
playlist_num_pages = 1 + max(map(int, re.findall(
r'href=".*?/m/videos/album/{}\?pnum=(\d+)"'.format(playlist_id), current_page)))
for n in range(2, playlist_num_pages):
# process the links on the current page (page n-1)
for uri in re.findall(r'href=".*?(/m/videos/vi... | ```suggestion
def _extract_from_page(self, page):
for url in re.findall(r'href=".*?(/m/videos/view/[^"]+)"', page):
yield self.url_result(f'https://www.eroprofile.com{url}', EroProfileIE.ie_key())
def _entries(self, playlist_id, first_page):
yield from self._extract_from_page(... | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
ExtractorError,
merge_dicts,
)
class EroProfileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
... | @@ -90,3 +90,48 @@ def _real_extract(self, url):
'title': title,
'age_limit': 18,
})
+
+
+class EroProfileAlbumIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/album/(?P<id>[^/]+)'
+ IE_NAME = 'EroProfile:album'
+
+ _TESTS = [{
+ 'url': '... | yt_dlp/extractor/eroprofile.py | 26 | Python | 1 | refactor | 1,098 | 27 | 130 | false | [eroprofile] Add album downloader | 658 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | jhwgh1968 |
height = int_or_none(media.get('dimensions', {}).get('height'))
width = int_or_none(media.get('dimensions', {}).get('width'))
description = try_get(
media, lambda x: x['edge_media_to_caption']['edges'][0]['node']['text'],
compat_str) or media.get('capt... | what's the point of a list comprehension if you are going to call `comment.get('node', {})` this multiple times?
Also it's a personal pref but the list comprehension is looking over complicated.
```py
for comment in media.get('edge_media_to_parent_comment', {}).get('edges', []):
comment_dict = comment.get('no... | height = int_or_none(media.get('dimensions', {}).get('height'))
width = int_or_none(media.get('dimensions', {}).get('width'))
description = try_get(
media, lambda x: x['edge_media_to_caption']['edges'][0]['node']['text'],
compat_str) or media.get('capt... | @@ -195,18 +195,19 @@ def get_count(keys, kind):
lambda x: x['%ss' % kind]['count'])))
if count is not None:
return count
+
like_count = get_count('preview_like', 'like')
comment_count = get_count(
... | yt_dlp/extractor/instagram.py | 26 | Python | 1 | question | 478 | 51 | 51 | false | [instagram] Fix comments extraction | 660 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | u-spec-png |
timestamp = int_or_none(media.get('taken_at_timestamp') or media.get('date'))
uploader = media.get('owner', {}).get('full_name')
uploader_id = media.get('owner', {}).get('username')
def get_count(keys, kind):
for key in variadic(keys):
... | just do
`'text': comment_text,` | timestamp = int_or_none(media.get('taken_at_timestamp') or media.get('date'))
uploader = media.get('owner', {}).get('full_name')
uploader_id = media.get('owner', {}).get('username')
def get_count(keys, kind):
for key in variadic(keys):
... | @@ -200,14 +200,18 @@ def get_count(keys, kind):
comment_count = get_count(
('preview_comment', 'to_comment', 'to_parent_comment'), 'comment')
- comments = [{
- 'author': comment.get('node', {}).get('owner', {}).get('username'),
- 'author_id': com... | yt_dlp/extractor/instagram.py | 26 | Python | 0.286 | suggestion | 33 | 51 | 51 | false | [instagram] Fix comments extraction | 660 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | u-spec-png |
# every queries are assumed to be a playlist
def _extract_from_playlist_data(self, value):
voice_id = compat_str(value['PlaylistId'])
upload_date = unified_strdate(value['Published'], False)
items = [self._extract_single_article(voice_data) for voice_data in value['VoiceData']]
r... | Did you miss `acodec`, or is it not known? In the latter case, you may want to either set a `quality` or `field_preference` so that sorting is correct | class VoicyBaseIE(InfoExtractor):
def _extract_from_playlist_data(self, value):
voice_id = compat_str(value.get('PlaylistId'))
upload_date = unified_strdate(value.get('Published'), False)
items = [self._extract_single_article(voice_data) for voice_data in value['VoiceData']]
return {... | @@ -0,0 +1,145 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import itertools
+
+
+class VoicyBaseIE(InfoE... | yt_dlp/extractor/voicy.py | 26 | Python | 0.714 | question | 150 | 51 | 51 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
message = traverse_obj(response, ('Value', 'Error', 'Message'), expected_type=compat_str)
if not message:
message = 'There was a error in the response: %d' % response['Status']
raise ExtractorError(message, expected=False)
return response['Value']
class Voic... | no need to match twice. you can just use `re.match(self.VALID_URL, ...)` | message = 'There was a error in the response: %d' % response.get('Status')
raise ExtractorError(message, expected=False)
return response.get('Value')
class VoicyIE(VoicyBaseIE):
IE_NAME = 'voicy'
_VALID_URL = r'https?://voicy\.jp/channel/(?P<channel_id>\d+)/(?P<id>\d+)'
... | @@ -0,0 +1,145 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import itertools
+
+
+class VoicyBaseIE(InfoE... | yt_dlp/extractor/voicy.py | 26 | Python | 0.571 | suggestion | 72 | 51 | 51 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'channel_id': compat_str(value['ChannelId']),
'upload_date': upload_date,
}
# NOTE: "article" in voicy = "track" in CDs = "chapter" in DVDs
def _extract_single_article(self, entry):
formats = [{
'url': entry['VoiceHlsFile'],
'format_id': 'hls',
... | What are these? extractors must not return undocumented public fields | 'channel_id': compat_str(value.get('ChannelId')),
'upload_date': upload_date,
}
def _extract_single_article(self, entry):
formats = [{
'url': entry['VoiceHlsFile'],
'format_id': 'hls',
'ext': 'm4a',
'acodec': 'aac',
... | @@ -0,0 +1,145 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import itertools
+
+
+class VoicyBaseIE(InfoE... | yt_dlp/extractor/voicy.py | 26 | Python | 0.357 | refactor | 69 | 51 | 51 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
}, {
'url': entry['VoiceFile'],
'format_id': 'mp3',
'ext': 'mp3',
'acodec': 'mp3',
'vcodec': 'none',
}]
self._sort_formats(formats)
return {
'id': compat_str(entry['ArticleId']),
'title': entry['ArticleTi... | shouldn't this be `VoicyPlaylistIE`? | }, {
'url': entry['VoiceFile'],
'format_id': 'mp3',
'ext': 'mp3',
'acodec': 'mp3',
'vcodec': 'none',
}]
self._sort_formats(formats)
return {
'id': compat_str(entry.get('ArticleId')),
'title': entry.get('A... | @@ -0,0 +1,145 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import itertools
+
+
+class VoicyBaseIE(InfoE... | yt_dlp/extractor/voicy.py | 26 | Python | 0.5 | question | 36 | 51 | 51 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
article_list = self._call_api(self.ARTICLE_LIST_API_URL % (channel_id, voice_id), voice_id)
return self._extract_from_playlist_data(article_list)
class VoicyChannelIE(VoicyBaseIE):
IE_NAME = 'voicy:channel'
_VALID_URL = r'https?://voicy\.jp/channel/(?P<id>\d+)'
PROGRAM_LIST_API_URL = '... | When there are extra network requests needed to get the pages, it should be done lazily. I believe I already explained this in detail in your other PR | return self._extract_from_playlist_data(article_list)
class VoicyChannelIE(VoicyBaseIE):
IE_NAME = 'voicy:channel'
_VALID_URL = r'https?://voicy\.jp/channel/(?P<id>\d+)'
PROGRAM_LIST_API_URL = 'https://vmw.api.voicy.jp/program_list/all?channel_id=%s&limit=20&public_type=3%s'
_TESTS = [{
... | @@ -0,0 +1,145 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import itertools
+
+
+class VoicyBaseIE(InfoE... | yt_dlp/extractor/voicy.py | 26 | Python | 0.5 | suggestion | 150 | 51 | 51 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
smuggle_url,
traverse_obj,
unsmuggle_url,
unified_strdate,
)
import re
import itertools
class VoicyBaseIE(InfoExtractor):
# every qu... | I thought you were gonna make this `multi_video`? | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
smuggle_url,
traverse_obj,
unsmuggle_url,
unified_strdate,
)
import re
import itertools
class VoicyBaseIE(InfoExtractor):
def _extra... | @@ -0,0 +1,152 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import re
+import itertools
+
+
+class VoicyB... | yt_dlp/extractor/voicy.py | 25 | Python | 0.286 | question | 49 | 50 | 50 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
@classmethod
def suitable(cls, url):
return not VoicyIE.suitable(url) and super(VoicyChannelIE, cls).suitable(url)
def _entries(self, channel_id):
pager = ''
for count in itertools.count(1):
article_list = self._call_api(self.PROGRAM_LIST_API_URL % (channel_id, pager), ... | ```suggestion
speaker_name = traverse_obj(first_article, ('SpeakerName', ), expected_type=compat_str)
if speaker_name:
title = 'Uploads from %s' % speaker_name
``` | @classmethod
def suitable(cls, url):
return not VoicyIE.suitable(url) and super(VoicyChannelIE, cls).suitable(url)
def _entries(self, channel_id):
pager = ''
for count in itertools.count(1):
article_list = self._call_api(self.PROGRAM_LIST_API_URL % (channel_id, pager), c... | @@ -0,0 +1,150 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import re
+import itertools
+
+
+class VoicyB... | yt_dlp/extractor/voicy.py | 26 | Python | 1 | suggestion | 207 | 43 | 41 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
pager = '&pid=%d&p_date=%s&play_count=%s' % (last['PlaylistId'], last['Published'], last['PlayCount'])
def _real_extract(self, url):
channel_id = self._match_id(url)
articles = self._entries(channel_id)
first_article = next(articles, None) # need the first item to get some inf... | Shouldn't this be either the speaker_name or channel name?
Maybe channel=channel name, uploader=speaker_name |
def _real_extract(self, url):
channel_id = self._match_id(url)
articles = self._entries(channel_id)
first_article = next(articles, None)
title = traverse_obj(first_article, ('ChannelName', ), expected_type=compat_str)
speaker_name = traverse_obj(first_article, ('SpeakerName... | @@ -0,0 +1,150 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import re
+import itertools
+
+
+class VoicyB... | yt_dlp/extractor/voicy.py | 26 | Python | 0.5 | suggestion | 109 | 29 | 27 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
pager = ''
for count in itertools.count(1):
article_list = self._call_api(self.PROGRAM_LIST_API_URL % (channel_id, pager), channel_id, note='Paging #%d' % count)
playlist_data = article_list.get('PlaylistData')
if not playlist_data:
break
y... | ```suggestion
playlist = (
``` | for count in itertools.count(1):
article_list = self._call_api(self.PROGRAM_LIST_API_URL % (channel_id, pager), channel_id, note='Paging #%d' % count)
playlist_data = article_list.get('PlaylistData')
if not playlist_data:
break
yield from playlist_... | @@ -0,0 +1,150 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import re
+import itertools
+
+
+class VoicyB... | yt_dlp/extractor/voicy.py | 26 | Python | 0.786 | suggestion | 40 | 37 | 35 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'uploader': 'ちょまど@ ITエンジニアなオタク',
'uploader_id': '7339',
},
'playlist_mincount': 54,
}]
@classmethod
def suitable(cls, url):
return not VoicyIE.suitable(url) and super(VoicyChannelIE, cls).suitable(url)
def _entries(self, channel_id):
pager = ''
... | ```suggestion
first_article = next(articles, None)
``` | 'uploader': 'ちょまど@ ITエンジニアなオタク',
'uploader_id': '7339',
},
'playlist_mincount': 54,
}]
@classmethod
def suitable(cls, url):
return not VoicyIE.suitable(url) and super(VoicyChannelIE, cls).suitable(url)
def _entries(self, channel_id):
pager = ''
... | @@ -0,0 +1,149 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import re
+import itertools
+
+
+class VoicyB... | yt_dlp/extractor/voicy.py | 26 | Python | 0.857 | suggestion | 64 | 48 | 47 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
def _entries(self, channel_id):
pager = ''
for count in itertools.count(1):
article_list = self._call_api(self.PROGRAM_LIST_API_URL % (channel_id, pager), channel_id, note='Paging #%d' % count)
playlist_data = article_list.get('PlaylistData')
if not playlist_data... | ```suggestion
articles = itertools.chain([first_article], articles) if first_article else articles
``` |
def _entries(self, channel_id):
pager = ''
for count in itertools.count(1):
article_list = self._call_api(self.PROGRAM_LIST_API_URL % (channel_id, pager), channel_id, note='Paging #%d' % count)
playlist_data = article_list.get('PlaylistData')
if not playlist_data... | @@ -0,0 +1,149 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import compat_str
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ traverse_obj,
+ unsmuggle_url,
+ unified_strdate,
+)
+
+import re
+import itertools
+
+
+class VoicyB... | yt_dlp/extractor/voicy.py | 26 | Python | 1 | suggestion | 112 | 39 | 38 | false | [voicy] add support for voicy.jp | 667 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
for (start_date, end_date) in spans:
videos = self._get_entries_for_date(search_url, query, start_date, endDate=end_date)
for video in videos:
yield video
def _get_spans_for_range(self, url, query, startDate, endDate):
page_50_results = self._get_entries_for_... | ```suggestion
link = '%s?page=%s&start=%s&end=%s&sort=f&order=d' % (url, pageNumber, startDate, endDate)
```
prefer using formatting instead of concatting, or use f-strings if that'd look cleaner | results = re.findall(r'(?<=data-video-id=)["\']?(?P<videoid>.*?)(?=["\'])', webpage)
for item in results:
yield self.url_result(f'http://www.nicovideo.jp/watch/{item}', 'Niconico', item)
if not results:
break
def _real_extract(self, url):
... | @@ -661,6 +662,87 @@ def pagefunc(pagenum):
}
+class NicovideoSearchURLIE(SearchInfoExtractor):
+ IE_NAME = "nicovideo:search"
+ IE_DESC = 'Nico video search'
+ _MAX_RESULTS = 1000000
+ _START_DATE = datetime.date(2007, 1, 1)
+ _MAX_NUMBER_OF_PAGES = 50
+ _RESULTS_PER_PAGE = 32
+ _VALI... | yt_dlp/extractor/niconico.py | 26 | Python | 0.857 | suggestion | 210 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | MinePlayersPE | animelover1984 |
data = get_page_data(0, 1)
title = data.get('name')
description = data.get('description')
uploader = data.get('owner').get('name')
uploader_id = data.get('owner').get('id')
def pagefunc(pagenum):
data = get_page_data(pagenum, 25)
return ({
... | Do we want a non-url search extractor? Looks like you had something originally but it was removed :confused: |
data = get_page_data(0, 1)
title = data.get('name')
description = data.get('description')
uploader = data.get('owner').get('name')
uploader_id = data.get('owner').get('id')
def pagefunc(pagenum):
data = get_page_data(pagenum, 25)
return ({
... | @@ -661,6 +662,87 @@ def pagefunc(pagenum):
}
+class NicovideoSearchURLIE(SearchInfoExtractor): | yt_dlp/extractor/niconico.py | 26 | Python | 0.429 | refactor | 109 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
def pagefunc(pagenum):
data = get_page_data(pagenum, 25)
return ({
'_type': 'url',
'url': 'http://www.nicovideo.jp/watch/' + item.get('watchId'),
} for item in data.get('items'))
return {
'_type': 'playlist',
'i... | Maybe another test where multiple spans are extracted | def pagefunc(pagenum):
data = get_page_data(pagenum, 25)
return ({
'_type': 'url',
'url': 'http://www.nicovideo.jp/watch/' + item.get('watchId'),
} for item in data.get('items'))
return {
'_type': 'playlist',
'i... | @@ -661,6 +662,87 @@ def pagefunc(pagenum):
}
+class NicovideoSearchURLIE(SearchInfoExtractor):
+ IE_NAME = "nicovideo:search"
+ IE_DESC = 'Nico video search'
+ _MAX_RESULTS = 1000000
+ _START_DATE = datetime.date(2007, 1, 1)
+ _MAX_NUMBER_OF_PAGES = 50
+ _RESULTS_PER_PAGE = 32
+ _VALI... | yt_dlp/extractor/niconico.py | 26 | Python | 0.286 | refactor | 53 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
def _entries(self, query):
"""Get a specified number of results for a query"""
currDate = datetime.datetime.now().date()
search_url = "http://www.nicovideo.jp/search/%s" % query
spans = self._get_spans_for_range(search_url, query, self._START_DATE, currDate)
for (start_date... | Maybe we should try make this function a loop rather than use recursion, and from there maybe a generator? |
def _entries(self, url, item_id, query=None, note='Downloading page %(page)s'):
query = query or {}
pages = [query['page']] if 'page' in query else itertools.count(1)
for page_num in pages:
query['page'] = str(page_num)
webpage = self._download_webpage(url, item_id, ... | @@ -661,6 +662,87 @@ def pagefunc(pagenum):
}
+class NicovideoSearchURLIE(SearchInfoExtractor):
+ IE_NAME = "nicovideo:search"
+ IE_DESC = 'Nico video search'
+ _MAX_RESULTS = 1000000
+ _START_DATE = datetime.date(2007, 1, 1)
+ _MAX_NUMBER_OF_PAGES = 50
+ _RESULTS_PER_PAGE = 32
+ _VALI... | yt_dlp/extractor/niconico.py | 26 | Python | 0.429 | question | 106 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
'id': 'sm9',
'title': 'sm9'
},
'playlist_mincount': 320,
}]
_API_HEADERS = {
'X-Frontend-ID': '6',
'X-Frontend-Version': '0'
}
def _entries(self, query):
"""Get a specified number of results for a query"""
currDate = datetime.date... | ```suggestion
page_50_length = sum(1 for _ in self._get_entries_for_date(url, query, startDate, endDate=endDate, pageNumber=50))
```
could also just use `len(list(generator()))`, performance benefit (if any) doesn't really matter in this context. | 'title': 'sm9'
},
'playlist_mincount': 40,
}, {
'url': 'https://www.nicovideo.jp/search/sm9?sort=h&order=d&end=2020-12-31&start=2020-01-01',
'info_dict': {
'id': 'sm9',
'title': 'sm9'
},
'playlist_count': 31,
}]
def _entrie... | @@ -661,6 +662,87 @@ def pagefunc(pagenum):
}
+class NicovideoSearchURLIE(SearchInfoExtractor):
+ IE_NAME = "nicovideo:search"
+ IE_DESC = 'Nico video search'
+ _MAX_RESULTS = 1000000
+ _START_DATE = datetime.date(2007, 1, 1)
+ _MAX_NUMBER_OF_PAGES = 50
+ _RESULTS_PER_PAGE = 32
+ _VALI... | yt_dlp/extractor/niconico.py | 26 | Python | 1 | performance | 257 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
videos = self._get_entries_for_date(search_url, query, start_date, endDate=end_date)
for video in videos:
yield video
def _get_spans_for_range(self, url, query, startDate, endDate):
page_50_results = self._get_entries_for_date(url, query, startDate, endDate=endDate, ... | ```suggestion
results = self._download_webpage(
url, None, note='Extracting results from page %s for date %s to %s' % (pageNumber, startDate, endDate),
query={
'Search_key': query,
'page': str(pageNumber),
'sta... | for item in results:
yield self.url_result(f'http://www.nicovideo.jp/watch/{item}', 'Niconico', item)
if not results:
break
def _real_extract(self, url):
query = self._match_id(url)
return self.playlist_result(self._entries(url, query), query,... | @@ -661,6 +662,87 @@ def pagefunc(pagenum):
}
+class NicovideoSearchURLIE(SearchInfoExtractor):
+ IE_NAME = "nicovideo:search"
+ IE_DESC = 'Nico video search'
+ _MAX_RESULTS = 1000000
+ _START_DATE = datetime.date(2007, 1, 1)
+ _MAX_NUMBER_OF_PAGES = 50
+ _RESULTS_PER_PAGE = 32
+ _VALI... | yt_dlp/extractor/niconico.py | 26 | Python | 0.857 | refactor | 545 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | animelover1984 |
class NicovideoSearchDateIE(NicovideoSearchIE):
IE_DESC = 'Nico video searches, newest first'
IE_NAME = f'{NicovideoSearchIE_NAME}:date'
_SEARCH_KEY = 'nicosearchdate'
_TESTS = [{
'url': 'nicosearchdateall:a',
'info_dict': {
'id': 'a',
'title': 'a'
},
... | @coletdjnz Removing this recursion is non-trivial as I understand. And it doesn't really matter unless there are millions of results. If you think this can be converted to loop easily, let me know how | IE_NAME = f'{NicovideoSearchIE_NAME}:date'
_SEARCH_KEY = 'nicosearchdate'
_TESTS = [{
'url': 'nicosearchdateall:a',
'info_dict': {
'id': 'a',
'title': 'a'
},
'playlist_mincount': 1610,
}]
_START_DATE = datetime.date(2007, 1, 1)
_RESULTS_PE... | @@ -661,6 +663,107 @@ def pagefunc(pagenum):
}
+NicovideoSearchIE_NAME = 'nicovideo:search'
+
+
+class NicovideoSearchURLIE(InfoExtractor):
+ IE_NAME = f'{NicovideoSearchIE_NAME}_url'
+ IE_DESC = 'Nico video search URLs'
+ _VALID_URL = r'https?://(?:www\.)?nicovideo\.jp/search/(?P<id>[^?#&]+)?'
+ ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.429 | suggestion | 200 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
_TESTS = [{
'url': 'http://www.nicovideo.jp/search/sm9',
'info_dict': {
'id': 'sm9',
'title': 'sm9'
},
'playlist_mincount': 40,
}, {
'url': 'https://www.nicovideo.jp/search/sm9?sort=h&order=d&end=2020-12-31&start=2020-01-01',
'info_dict': {... | This method causes the download of one extra page. Your old method of checking if there are 32 vids avoids that. You can re-implement that logic if you want @animelover1984 | 'url': 'http://www.nicovideo.jp/search/sm9',
'info_dict': {
'id': 'sm9',
'title': 'sm9'
},
'playlist_mincount': 40,
}, {
'url': 'https://www.nicovideo.jp/search/sm9?sort=h&order=d&end=2020-12-31&start=2020-01-01',
'info_dict': {
'id... | @@ -661,6 +663,107 @@ def pagefunc(pagenum):
}
+NicovideoSearchIE_NAME = 'nicovideo:search'
+
+
+class NicovideoSearchURLIE(InfoExtractor):
+ IE_NAME = f'{NicovideoSearchIE_NAME}_url'
+ IE_DESC = 'Nico video search URLs'
+ _VALID_URL = r'https?://(?:www\.)?nicovideo\.jp/search/(?P<id>[^?#&]+)?'
+ ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.429 | suggestion | 173 | 51 | 51 | false | [Niconico] Added Nico Search Extractor | 672 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
'thumbnail': r're:https://s[0-9]+.filmmodu.org/uploads/movie/cover/3646/6xKCYgH16UuwEGAyroLU6p8HLIn.jpg',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._og_search_title(webpage, fatal=T... | ```suggestion
formats = [{
'url': source['src'],
'format_id': source.get('label'),
'width': int_or_none(source.get('res')),
} for source in data['sources']]
``` | 'thumbnail': r're:https://s[0-9]+.filmmodu.org/uploads/movie/cover/3646/6xKCYgH16UuwEGAyroLU6p8HLIn.jpg',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._og_search_title(webpage, fatal=T... | @@ -0,0 +1,75 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import int_or_none
+
+
+class FilmmoduIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www.)?filmmodu.org/(?P<id>[^/]+-(?:turkce-dublaj-izle|altyazili-izle))'
+ _TESTS = [{
+ 'url': ... | yt_dlp/extractor/filmmodu.py | 26 | Python | 1 | suggestion | 220 | 44 | 43 | false | [filmmodu] Add new extractor | 690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
video_type = self._search_regex(r'var\s*videoType\s*=\s*\'([a-z]+)\'', webpage, 'video_type')
data = self._download_json('https://www.filmmodu.org/get-source', real_video_id, query={
'movie_id': real_video_id,
'type': video_type,
})
formats = [
{
... | ```suggestion
'display_id': video_id,
'title': title,
``` | video_type = self._search_regex(r'var\s*videoType\s*=\s*\'([a-z]+)\'', webpage, 'video_type')
data = self._download_json('https://www.filmmodu.org/get-source', real_video_id, query={
'movie_id': real_video_id,
'type': video_type,
})
formats = [{
'url':... | @@ -0,0 +1,75 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import int_or_none
+
+
+class FilmmoduIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www.)?filmmodu.org/(?P<id>[^/]+-(?:turkce-dublaj-izle|altyazili-izle))'
+ _TESTS = [{
+ 'url': ... | yt_dlp/extractor/filmmodu.py | 26 | Python | 0.857 | suggestion | 84 | 33 | 32 | false | [filmmodu] Add new extractor | 690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class FilmmoduIE(InfoExtractor):
_VALID_URL = r'https?://(?:www.)?filmmodu.org/(?P<id>[^/]+-(?:turkce-dublaj-izle|altyazili-izle))'
_TESTS = [{
'url': 'https://www.filmmodu.org/f9... | The video's ext is clearly not `m3u8`. This should be set correctly | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class FilmmoduIE(InfoExtractor):
_VALID_URL = r'https?://(?:www.)?filmmodu.org/(?P<id>[^/]+-(?:turkce-dublaj-izle|altyazili-izle))'
_TESTS = [{
'url': 'https://www.filmmodu.org/f9... | @@ -0,0 +1,72 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import int_or_none
+
+
+class FilmmoduIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www.)?filmmodu.org/(?P<id>[^/]+-(?:turkce-dublaj-izle|altyazili-izle))'
+ _TESTS = [{
+ 'url': ... | yt_dlp/extractor/filmmodu.py | 15 | Python | 0.571 | suggestion | 67 | 40 | 40 | false | [filmmodu] Add new extractor | 690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
'md5': '04c16707a945130246876b9b58b3a365',
'info_dict': {
'id': '3646',
'ext': 'm3u8',
'title': 'Baba',
'description': 'md5:d43fd651937cd75cc650883ebd8d8461',
'thumbnail': r're:https://s[0-9]+.filmmodu.org/uploads/movie/cover/3646/6xKCYgH16UuwE... | are you sure this is width and not height? | 'md5': '109f2fcb9c941330eed133971c035c00',
'info_dict': {
'id': '3646',
'ext': 'mp4',
'title': 'Baba',
'description': 'md5:d43fd651937cd75cc650883ebd8d8461',
'thumbnail': r're:https://s[0-9]+.filmmodu.org/uploads/movie/cover/3646/6xKCYgH16UuwEG... | @@ -0,0 +1,72 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import int_or_none
+
+
+class FilmmoduIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www.)?filmmodu.org/(?P<id>[^/]+-(?:turkce-dublaj-izle|altyazili-izle))'
+ _TESTS = [{
+ 'url': ... | yt_dlp/extractor/filmmodu.py | 26 | Python | 0.071 | question | 42 | 47 | 49 | false | [filmmodu] Add new extractor | 690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
}]
def _get_n_results(self, category, subcategory, n, match=None):
query = "%s: %s" % (category, subcategory)
# map of categories : subcategories : RIDs
rid_map = {
"kichiku": {
"mad": 26,
"manual_vocaloid": 126,
"guide": 22,
... | I think convention is to use `self._parse_json`
edit: or use `self._download_json` as I suggested in another comment | }]
def _fetch_page(self, api_url, num_pages, query, page_num):
parsed_json = self._download_json(
api_url, query, query={'Search_key': query, 'pn': page_num},
note='Extracting results from page %s of %s' % (page_num, num_pages))
video_list = try_get(parsed_json, lambda ... | @@ -535,6 +539,93 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 117 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
def _get_n_results(self, category, subcategory, n, match=None):
query = "%s: %s" % (category, subcategory)
# map of categories : subcategories : RIDs
rid_map = {
"kichiku": {
"mad": 26,
"manual_vocaloid": 126,
"guide": 22,
... | probably want to safely extract the count and size and raise an ExtractorError if we fail to do so.
Something like this maybe (assuming count and size should not be 0 as well):
```suggestion
data_page = try_get(parsed_json, lambda x: x['data']['page'], dict) or {}
count, size = int_or_none(data_pa... |
def _fetch_page(self, api_url, num_pages, query, page_num):
parsed_json = self._download_json(
api_url, query, query={'Search_key': query, 'pn': page_num},
note='Extracting results from page %s of %s' % (page_num, num_pages))
video_list = try_get(parsed_json, lambda x: x['d... | @@ -535,6 +539,93 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | bug | 502 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
"kichiku": {
"mad": 26,
"manual_vocaloid": 126,
"guide": 22,
"theatre": 216,
"course": 127
},
}
if category not in rid_map:
raise ExtractorError("The supplied category, %s, is not support... | step seems redundant?
```suggestion
for page_number in range(1, num_pages + 1):
``` |
video_list = try_get(parsed_json, lambda x: x['data']['archives'], list)
if not video_list:
raise ExtractorError('Failed to retrieve video list for page %d' % page_num)
for video in video_list:
yield self.url_result(
'https://www.bilibili.com/video/%s' %... | @@ -535,6 +539,93 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.857 | suggestion | 96 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
if matches is None:
video_list_processed = video_list_processed[:idx]
should_brk = True
break
entries += video_list_processed
if(len(entries) >= n or len(entries) >= BilibiliCategoryIE._MAX_RESULTS) or s... | use single quotes e.g.
```suggestion
category = u.path.split('/')[2]
subcategory = u.path.split('/')[3]
count_items_to_fetch = int(self.get_param('playlist_end')) if self.get_param('playlist_end') else self._MAX_RESULTS
return self._get_n_results(category, subcategory, count_items... | self._fetch_page, api_url, num_pages, query), size)
def _real_extract(self, url):
u = compat_urllib_parse_urlparse(url)
category, subcategory = u.path.split('/')[2:4]
query = '%s: %s' % (category, subcategory)
return self.playlist_result(self._entries(category, subcateg... | @@ -535,6 +539,93 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 367 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
"manual_vocaloid": 126,
"guide": 22,
"theatre": 216,
"course": 127
},
}
if category not in rid_map:
raise ExtractorError("The supplied category, %s, is not supported" % category)
if subcategory not in rid_m... | `self._download_json` might be more appropriate? | if not video_list:
raise ExtractorError('Failed to retrieve video list for page %d' % page_num)
for video in video_list:
yield self.url_result(
'https://www.bilibili.com/video/%s' % video['bvid'], 'BiliBili', video['bvid'])
def _entries(self, category, subca... | @@ -535,6 +539,93 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.286 | question | 48 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | animelover1984 |
list_id)['data']
max_count = max_count or try_get(data, lambda x: x['page']['count'])
entries = try_get(data, lambda x: x['list']['vlist'])
if not entries:
return
for entry in entries:
yield self.url_result(
... | Python's `r` string and `re` module does not require escaping `/`es. It's JavaScript thing. | list_id)['data']
max_count = max_count or try_get(data, lambda x: x['page']['count'])
entries = try_get(data, lambda x: x['list']['vlist'])
if not entries:
return
for entry in entries:
yield self.url_result(
... | @@ -535,6 +539,83 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.357 | suggestion | 91 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | animelover1984 |
for page_number in range(1, num_pages + 1):
time.sleep(2)
json_str = self._download_json(
api_url + "&pn=%s" % page_number,'None', query={"Search_key": query},
note='Extracting results from page %s of %s' % (page_number, num_pages))
# Ascen... | ```suggestion
u = compat_urllib_parse_urlparse(url)
category, subcategory = u.path.split('/')[2:3]
```
or should use regex groups | raise ExtractorError('The subcategory, %s, isn\'t supported for this category. Supported subcategories: %s' % (subcategory, list(rid_map[category].keys())))
rid_value = rid_map[category][subcategory]
api_url = 'https://api.bilibili.com/x/web-interface/newlist?rid=%d&type=1&ps=20&jsonp=json... | @@ -535,6 +539,83 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 149 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | animelover1984 |
data = self._parse_json(
self._download_webpage(
self._API_URL % (list_id, page_num), list_id,
note='Downloading page %d' % page_num),
list_id)['data']
max_count = max_count or try_get(data, lambda x: x['page']['count'])
... | ~~what is this?~~ nvm, I see this is example URL
```suggestion
``` | data = self._parse_json(
self._download_webpage(
self._API_URL % (list_id, page_num), list_id,
note='Downloading page %d' % page_num),
list_id)['data']
max_count = max_count or try_get(data, lambda x: x['page']['count'])
... | @@ -535,6 +539,83 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/ | yt_dlp/extractor/bilibili.py | 26 | Python | 0.857 | suggestion | 68 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
'info_dict': {
'id': 'kichiku: mad',
},
'playlist_maxcount': 45,
'params': {
"playlist_end": '45'
}
}]
def _entries(self, category, subcategory, query):
# map of categories : subcategories : RIDs
rid_map = {
"kichiku": ... | The error message should explain which categories are supported | 'id': 'kichiku: mad',
'title': 'kichiku: mad'
},
'playlist_mincount': 45,
'params': {
'playlistend': 45
}
}]
def _fetch_page(self, api_url, num_pages, query, page_num):
parsed_json = self._download_json(
api_url, query, que... | @@ -535,6 +539,83 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.643 | suggestion | 63 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
def _entries(self, category, subcategory, query):
# map of categories : subcategories : RIDs
rid_map = {
"kichiku": {
"mad": 26,
"manual_vocaloid": 126,
"guide": 22,
"theatre": 216,
"course": 127
... | Since the size of each page is known in advance, you might wanna consider using a PagedList |
def _fetch_page(self, api_url, num_pages, query, page_num):
parsed_json = self._download_json(
api_url, query, query={'Search_key': query, 'pn': page_num},
note='Extracting results from page %s of %s' % (page_num, num_pages))
video_list = try_get(parsed_json, lambda x: x['d... | @@ -535,6 +539,83 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.357 | suggestion | 91 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
if subcategory not in rid_map[category]:
raise ExtractorError("The supplied subcategory, %s, is not supported" % subcategory)
rid_value = rid_map[category][subcategory]
api_url = "https://api.bilibili.com/x/web-interface/newlist?rid=%d&type=1&ps=20&jsonp=jsonp" % rid_value
... | Why sort by published date? Unless there is a specific reason for this, it should return in same order as is fetched | # map of categories : subcategories : RIDs
rid_map = {
'kichiku': {
'mad': 26,
'manual_vocaloid': 126,
'guide': 22,
'theatre': 216,
'course': 127
},
}
if category not in rid_map:
... | @@ -535,6 +539,83 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = "Bilibili category extractor"
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?:\/... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.5 | question | 116 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
list_id = self._match_id(url)
return self.playlist_result(self._entries(list_id), list_id)
# https://www.bilibili.com/v/kichiku/mad/#/
class BilibiliCategoryIE(SearchInfoExtractor):
IE_NAME = 'Bilibili category extractor'
_MAX_RESULTS = 1000000
_VALID_URL = r'https?://www\.bilibili\.com/v/... | ```suggestion
api_url + '&pn=%s' % page_num, query, query={'Search_key': query},
``` | return self.playlist_result(self._entries(list_id), list_id)
class BilibiliCategoryIE(InfoExtractor):
IE_NAME = 'Bilibili category extractor'
_MAX_RESULTS = 1000000
_VALID_URL = r'https?://www\.bilibili\.com/v/[a-zA-Z]+\/[a-zA-Z]+'
_TESTS = [{
'url': 'https://www.bilibili.com/v/kichiku... | @@ -535,6 +540,84 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.857 | suggestion | 98 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
'info_dict': {
'id': 'kichiku: mad',
'title': 'kichiku: mad'
},
'playlist_mincount': 45,
'params': {
'playlistend': 45
}
}]
def _fetch_page(self, api_url, num_pages, query, page_num):
time.sleep(2)
parsed_json = self._... | ```suggestion
for video in video_list:
yield self.url_result(
'https://www.bilibili.com/video/%s' % video['bvid'], 'BiliBili', video['bvid'])
``` | 'title': 'kichiku: mad'
},
'playlist_mincount': 45,
'params': {
'playlistend': 45
}
}]
def _fetch_page(self, api_url, num_pages, query, page_num):
parsed_json = self._download_json(
api_url, query, query={'Search_key': query, 'pn': pag... | @@ -535,6 +540,84 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 185 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
for video in video_list_processed:
yield video
def _entries(self, category, subcategory, query):
# map of categories : subcategories : RIDs
rid_map = {
'kichiku': {
'mad': 26,
'manual_vocaloid': 126,
'guide': 22,
... | ```suggestion
page_json = self._download_json(api_url + '&pn=1', query, query={'Search_key': query})
``` | rid_map = {
'kichiku': {
'mad': 26,
'manual_vocaloid': 126,
'guide': 22,
'theatre': 216,
'course': 127
},
}
if category not in rid_map:
raise ExtractorError('The supplied category... | @@ -535,6 +540,84 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 114 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
self._download_webpage(
self._API_URL % (list_id, page_num), list_id,
note='Downloading page %d' % page_num),
list_id)['data']
max_count = max_count or try_get(data, lambda x: x['page']['count'])
entries = try_get(data, la... | Why inherit from `SearchInfoExtractor`? This is behaving like a normal `InfoExtractor` | self._API_URL % (list_id, page_num), list_id,
note='Downloading page %d' % page_num),
list_id)['data']
max_count = max_count or try_get(data, lambda x: x['page']['count'])
entries = try_get(data, lambda x: x['list']['vlist'])
... | @@ -535,6 +540,84 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(SearchInfoExtractor): | yt_dlp/extractor/bilibili.py | 26 | Python | 0.571 | refactor | 86 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | animelover1984 |
# https://www.bilibili.com/v/kichiku/mad/#/
class BilibiliCategoryIE(InfoExtractor):
IE_NAME = 'Bilibili category extractor'
_MAX_RESULTS = 1000000
_VALID_URL = r'https?://www\.bilibili\.com/v/[a-zA-Z]+\/[a-zA-Z]+'
_TESTS = [{
'url': 'https://www.bilibili.com/v/kichiku/mad',
'info_dict'... | Shouldn't it be like this?
```suggestion
raise ExtractorError('Failed to retrieve video list for page %d' % page_num)
``` |
class BilibiliCategoryIE(InfoExtractor):
IE_NAME = 'Bilibili category extractor'
_MAX_RESULTS = 1000000
_VALID_URL = r'https?://www\.bilibili\.com/v/[a-zA-Z]+\/[a-zA-Z]+'
_TESTS = [{
'url': 'https://www.bilibili.com/v/kichiku/mad',
'info_dict': {
'id': 'kichiku: mad',
... | @@ -535,6 +539,80 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(InfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://www\.b... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | bug | 136 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | animelover1984 |
def _real_extract(self, url):
list_id = self._match_id(url)
return self.playlist_result(self._entries(list_id), list_id)
# https://www.bilibili.com/v/kichiku/mad/#/
class BilibiliCategoryIE(InfoExtractor):
IE_NAME = 'Bilibili category extractor'
_MAX_RESULTS = 1000000
_VALID_URL = r'h... | ```suggestion
api_url, query, query={'Search_key': query, 'pn': page_num},
```
should do the same thing |
def _real_extract(self, url):
list_id = self._match_id(url)
return self.playlist_result(self._entries(list_id), list_id)
class BilibiliCategoryIE(InfoExtractor):
IE_NAME = 'Bilibili category extractor'
_MAX_RESULTS = 1000000
_VALID_URL = r'https?://www\.bilibili\.com/v/[a-zA-Z]+\/[a-z... | @@ -535,6 +539,80 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(InfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://www\.b... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 120 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | animelover1984 |
for video in video_list:
yield self.url_result(
'https://www.bilibili.com/video/%s' % video['bvid'], 'BiliBili', video['bvid'])
def _entries(self, category, subcategory, query):
# map of categories : subcategories : RIDs
rid_map = {
'kichiku': {
... | ```suggestion
page_json = self._download_json(api_url, query, query={'Search_key': query, 'pn': '1'})
```
this too | yield self.url_result(
'https://www.bilibili.com/video/%s' % video['bvid'], 'BiliBili', video['bvid'])
def _entries(self, category, subcategory, query):
# map of categories : subcategories : RIDs
rid_map = {
'kichiku': {
'mad': 26,
... | @@ -535,6 +539,80 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(InfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://www\.b... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 127 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | animelover1984 |
rid_map = {
'kichiku': {
'mad': 26,
'manual_vocaloid': 126,
'guide': 22,
'theatre': 216,
'course': 127
},
}
if category not in rid_map:
raise ExtractorError('The supplied category... | ```suggestion
num_pages = math.ceil(count / size)
```
should use the value we get above | 'kichiku': {
'mad': 26,
'manual_vocaloid': 126,
'guide': 22,
'theatre': 216,
'course': 127
},
}
if category not in rid_map:
raise ExtractorError('The supplied category, %s, is not support... | @@ -535,6 +539,80 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(InfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://www\.b... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 100 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | animelover1984 |
def _entries(self, category, subcategory, query):
# map of categories : subcategories : RIDs
rid_map = {
'kichiku': {
'mad': 26,
'manual_vocaloid': 126,
'guide': 22,
'theatre': 216,
'course': 127
... | ```suggestion
if count is None or not size:
```
`size == 0` causes DIV/0, but `count == 0` don't | def _entries(self, category, subcategory, query):
# map of categories : subcategories : RIDs
rid_map = {
'kichiku': {
'mad': 26,
'manual_vocaloid': 126,
'guide': 22,
'theatre': 216,
'course': 127
... | @@ -535,6 +539,80 @@ def _real_extract(self, url):
return self.playlist_result(self._entries(list_id), list_id)
+# https://www.bilibili.com/v/kichiku/mad/#/
+class BilibiliCategoryIE(InfoExtractor):
+ IE_NAME = 'Bilibili category extractor'
+ _MAX_RESULTS = 1000000
+ _VALID_URL = r'https?://www\.b... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 109 | 51 | 51 | false | [bilibili] Category Extractor | 695 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | animelover1984 |
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/album/(?P<id>[^/]+)'
IE_NAME = 'EroProfile:album'
_TESTS = [{
'url': 'https://www.eroprofile.com/m/videos/album/BBW-2-893',
'info_dict': {
'id': 'BBW-2-893',
'title': 'BBW 2'
},
'playlist_minc... | ```suggestion
url = f'https://www.eroprofile.com/m/videos/album/{playlist_id}?pnum={n}'
``` | _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/album/(?P<id>[^/]+)'
IE_NAME = 'EroProfile:album'
_TESTS = [{
'url': 'https://www.eroprofile.com/m/videos/album/BBW-2-893',
'info_dict': {
'id': 'BBW-2-893',
'title': 'BBW 2'
},
'playlist_minc... | @@ -113,12 +113,15 @@ def _extract_from_page(self, page):
def _entries(self, playlist_id, first_page):
yield from self._extract_from_page(first_page)
+ # using the url of the last page, find the biggest page number
page_urls = re.findall(rf'href=".*?(/m/videos/album/{playlist_id}\?pnum=(... | yt_dlp/extractor/eroprofile.py | 26 | Python | 0.714 | suggestion | 105 | 38 | 37 | false | [eroprofile] fix page skipping in albums | 701 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | jhwgh1968 |
__typename
}
voteCount {
positive
__typename
}
linkedUser {
_id
username
__typename
}
createdAt
__typename
}'''
_GRAPHQL_GETCOMMENTSREPLIES_QUERY = '''
query GetCommentReplies($id: String!, $limit: Float, $offset: Float) {
getCommentRep... | This `fragment` is the same as on line 69-89. Could be represented once and the concatenated to the comment queries. | voteCount {
positive
}
createdAt
replyCount
}
}'''
_GRAPHQL_QUERIES = {
'GetVideoAndComments': _GRAPHQL_GETMETADATA_QUERY,
'GetCommentReplies': _GRAPHQL_GETCOMMENTSREPLIES_QUERY,
}
def _call_api(self, video_id, id, operation, note):
r... | @@ -0,0 +1,235 @@
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+
+from ..utils import (
+ try_get,
+ int_or_none,
+ url_or_none,
+ float_or_none,
+ unified_timestamp,
+ unified_strdate,
+)
+
+
+class BannedVideoIE(InfoExtractor):
+ _GRAPHQL_API = 'htt... | yt_dlp/extractor/bannedvideo.py | 26 | Python | 0.714 | suggestion | 116 | 51 | 51 | false | [BannedVideo] Add Extractor | 717 | yt-dlp/yt-dlp | 132,642 | Python | blackjack4494 | CHJ85 |
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
try_get,
int_or_none,
url_or_none,
float_or_none,
unified_timestamp,
unified_strdate,
)
class BannedVideoIE(InfoExtractor):
_GRAPHQL_API = 'https://api.infowarsmedia.com/graphql'
... | Why don't you combine all three queries together into one request? | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
try_get,
int_or_none,
url_or_none,
float_or_none,
unified_timestamp,
)
class BannedVideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?banned\.video/watch\?id=(?P<id>[0-f]{24})'
... | @@ -0,0 +1,235 @@
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+
+from ..utils import (
+ try_get,
+ int_or_none,
+ url_or_none,
+ float_or_none,
+ unified_timestamp,
+ unified_strdate,
+)
+
+
+class BannedVideoIE(InfoExtractor):
+ _GRAPHQL_API = 'htt... | yt_dlp/extractor/bannedvideo.py | 22 | Python | 0.143 | question | 66 | 47 | 47 | false | [BannedVideo] Add Extractor | 717 | yt-dlp/yt-dlp | 132,642 | Python | blackjack4494 | CHJ85 |
_GRAPHQL_API = 'https://api.infowarsmedia.com/graphql'
_GRAPHQL_HEADERS = {
'Content-Type': 'application/json; charset=utf-8'
}
_GRAPHQL_GETVIDEO_QUERY = '''
query GetVideo($id: String!) {
getVideo(id: $id) {
...DisplayVideoFields
streamUrl
directUrl
unlisted
... | There is more metadata available such as `likes` etc. Why don't include them as well? | 'url': 'https://banned.video/watch?id=5e7a859644e02200c6ef5f11',
'md5': '14b6e81d41beaaee2215cd75c6ed56e4',
'info_dict': {
'id': '5e7a859644e02200c6ef5f11',
'ext': 'mp4',
'title': 'China Discovers Origin of Corona Virus: Issues Emergency Statement',
... | @@ -0,0 +1,235 @@
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+
+from ..utils import (
+ try_get,
+ int_or_none,
+ url_or_none,
+ float_or_none,
+ unified_timestamp,
+ unified_strdate,
+)
+
+
+class BannedVideoIE(InfoExtractor):
+ _GRAPHQL_API = 'htt... | yt_dlp/extractor/bannedvideo.py | 26 | Python | 0.357 | question | 85 | 51 | 51 | false | [BannedVideo] Add Extractor | 717 | yt-dlp/yt-dlp | 132,642 | Python | blackjack4494 | CHJ85 |
'id': '5e7a859644e02200c6ef5f11',
'ext': 'mp4',
'title': 'China Discovers Origin of Corona Virus: Issues Emergency Statement',
'thumbnail': r're:^https?://(?:www\.)?assets\.infowarsmedia.com/images/',
'description': 'The Chinese Communist Party Official Spokes... | Right now only the default value for comment limit is requested. But if there are more they won't be requested. |
def _real_extract(self, url):
video_id = self._match_id(url)
video_json = self._call_api(video_id, video_id, 'GetVideoAndComments', 'Downloading video metadata')
video_info = video_json['getVideo']
is_live = video_info.get('live')
comments = [self._parse_comment(comment, 'ro... | @@ -0,0 +1,235 @@
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+
+from ..utils import (
+ try_get,
+ int_or_none,
+ url_or_none,
+ float_or_none,
+ unified_timestamp,
+ unified_strdate,
+)
+
+
+class BannedVideoIE(InfoExtractor):
+ _GRAPHQL_API = 'htt... | yt_dlp/extractor/bannedvideo.py | 26 | Python | 0.286 | suggestion | 111 | 51 | 40 | false | [BannedVideo] Add Extractor | 717 | yt-dlp/yt-dlp | 132,642 | Python | blackjack4494 | CHJ85 |
from ..utils import (
ExtractorError,
update_url_query,
clean_html,
unified_timestamp,
time_millis,
)
from ..compat import compat_urllib_parse
class RadikoBaseIE(InfoExtractor):
_FULL_KEY = None
_AUTH_CACHE = ()
def _auth_client(self):
if self._AUTH_CACHE:
return s... | ```suggestion
_, auth1_handle = self._download_webpage_handle(
'https://radiko.jp/v2/api/auth1', None, 'Downloading authentication page',
headers={
'x-radiko-app': 'pc_html5',
'x-radiko-app-version': '0.0.1',
'x-radiko-device': 'pc',
... | from ..utils import (
ExtractorError,
update_url_query,
clean_html,
unified_timestamp,
)
from ..compat import compat_urllib_parse
class RadikoBaseIE(InfoExtractor):
_FULL_KEY = None
def _auth_client(self):
auth_cache = self._downloader.cache.load('radiko', 'auth_data')
if auth... | @@ -0,0 +1,276 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+ time_millis,
+)
+from ..compat i... | yt_dlp/extractor/radiko.py | 26 | Python | 1 | security | 388 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
class RadikoBaseIE(InfoExtractor):
_FULL_KEY = None
_AUTH_CACHE = ()
def _auth_client(self):
if self._AUTH_CACHE:
return self._AUTH_CACHE
auth1_handle = self._download_webpage_handle(
'https://radiko.jp/v2/api/auth1', None, 'Authenticating (1)',
headers=... | ```suggestion
'https://radiko.jp/v2/api/auth2', None, 'Authenticating',
``` | _FULL_KEY = None
def _auth_client(self):
auth_cache = self._downloader.cache.load('radiko', 'auth_data')
if auth_cache:
return auth_cache
_, auth1_handle = self._download_webpage_handle(
'https://radiko.jp/v2/api/auth1', None, 'Downloading authentication page',
... | @@ -0,0 +1,276 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+ time_millis,
+)
+from ..compat i... | yt_dlp/extractor/radiko.py | 26 | Python | 0.857 | security | 89 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
# QRR (文化放送) station provides <desc>
'url': 'https://radiko.jp/#!/live/QRR',
'only_matching': True,
}, {
# FMT (TOKYO FM) station does not provide <desc>
'url': 'https://radiko.jp/#!/live/FMT',
'only_matching': True,
}, {
'url': 'https://radiko.jp/#!/live/... | lots of duplicated code. Try to move common logic into BaseIE | }
class RadikoRadioIE(RadikoBaseIE):
_VALID_URL = r'https?://(?:www\.)?radiko\.jp/#!/live/(?P<id>[A-Z0-9-]+)'
_TESTS = [{
# QRR (文化放送) station provides <desc>
'url': 'https://radiko.jp/#!/live/QRR',
'only_matching': True,
}, {
# FMT (TOKYO FM) station does not prov... | @@ -0,0 +1,276 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+ time_millis,
+)
+from ..compat i... | yt_dlp/extractor/radiko.py | 26 | Python | 0.357 | refactor | 61 | 51 | 50 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
# coding: utf-8
from __future__ import unicode_literals
import re
import base64
import calendar
import datetime
from .common import InfoExtractor
from ..utils import (
ExtractorError,
update_url_query,
clean_html,
unified_timestamp,
)
from ..compat import compat_urllib_parse
class RadikoBaseIE(InfoE... | If these are not expected to change between runs, you can cache them in `self._downloader.cache`. See soundcloud/youtube for example | # coding: utf-8
from __future__ import unicode_literals
import re
import base64
import calendar
import datetime
from .common import InfoExtractor
from ..utils import (
ExtractorError,
update_url_query,
clean_html,
unified_timestamp,
)
from ..compat import compat_urllib_parse
class RadikoBaseIE(InfoE... | @@ -0,0 +1,228 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+)
+from ..compat import compat_urlli... | yt_dlp/extractor/radiko.py | 21 | Python | 0.714 | performance | 132 | 46 | 46 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
m3u8_playlist_data = self._download_xml(
'https://radiko.jp/v3/station/stream/pc_html5/%s.xml' % station, video_id,
note='Downloading m3u8 information')
m3u8_urls = m3u8_playlist_data.findall('.//url')
formats = []
found = set()
for url_tag in m3u8_urls:
... | ```suggestion
playlist_url, video_id, ext='m4a',
```
live=True takes care of it
The reason I dont want extractors defining the protocols explicitly without good reason is that if we ever implement native live m3u8, we'll need to come back and tweak every extractor that does this | def _extract_formats(self, video_id, station, is_onair, ft, cursor, auth_token, area_id, query):
m3u8_playlist_data = self._download_xml(
'https://radiko.jp/v3/station/stream/pc_html5/%s.xml' % station, video_id,
note='Downloading m3u8 information')
m3u8_urls = m3u8_playlist_... | @@ -0,0 +1,228 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+)
+from ..compat import compat_urlli... | yt_dlp/extractor/radiko.py | 26 | Python | 1 | refactor | 301 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'station_id': station,
**query,
'l': '15',
'lsid': '77d0678df93a1034659c14d6fc89f018',
'type': 'b',
})
if playlist_url in found:
continue
else:
found.add(playlist_url)
... | either add the note, or remove the comment | playlist_url = update_url_query(pcu.text, {
'station_id': station,
**query,
'l': '15',
'lsid': '77d0678df93a1034659c14d6fc89f018',
'type': 'b',
})
if playlist_url in found:
continue
... | @@ -0,0 +1,228 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+)
+from ..compat import compat_urlli... | yt_dlp/extractor/radiko.py | 26 | Python | 0.286 | suggestion | 42 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
}, {
# FMT (TOKYO FM) station does not provide <desc>
'url': 'https://radiko.jp/#!/ts/FMT/20210810150000',
'only_matching': True,
}, {
'url': 'https://radiko.jp/#!/ts/JOAK-FM/20210509090000',
'only_matching': True,
}]
def _real_extract(self, url):
station... | instead of comments, use better name for the vars | 'only_matching': True,
}, {
# FMT (TOKYO FM) station does not provide <desc>
'url': 'https://radiko.jp/#!/ts/FMT/20210810150000',
'only_matching': True,
}, {
'url': 'https://radiko.jp/#!/ts/JOAK-FM/20210509090000',
'only_matching': True,
}]
def _real_extr... | @@ -0,0 +1,228 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+)
+from ..compat import compat_urlli... | yt_dlp/extractor/radiko.py | 26 | Python | 0.286 | suggestion | 49 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
_TESTS = [{
# QRR (文化放送) station provides <desc>
'url': 'https://radiko.jp/#!/ts/QRR/20210425101300',
'only_matching': True,
}, {
# FMT (TOKYO FM) station does not provide <desc>
'url': 'https://radiko.jp/#!/ts/FMT/20210810150000',
'only_matching': True,
}, {
... | too many ordered args. using kwargs style here will help with readability |
_TESTS = [{
# QRR (文化放送) station provides <desc>
'url': 'https://radiko.jp/#!/ts/QRR/20210425101300',
'only_matching': True,
}, {
# FMT (TOKYO FM) station does not provide <desc>
'url': 'https://radiko.jp/#!/ts/FMT/20210810150000',
'only_matching': True,
}, {... | @@ -0,0 +1,228 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+)
+from ..compat import compat_urlli... | yt_dlp/extractor/radiko.py | 26 | Python | 0.143 | style | 73 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
auth_token, area_id = self._auth_client()
prog, station_program, ft, ft_str, to_str = self._find_program(video_id, station, vid_int)
title = prog.find('title').text
description = clean_html(prog.find('info').text)
station_name = station_program.find('.//name').text
fo... | wdym? it IS live unless I am mistaken. Note that live doesn't mean the video is being recorded and played back at real time; just that it is a livestream (eg: youtube premiers are considered live) | vid_int = unified_timestamp(video_id, False)
auth_token, area_id = self._auth_client()
prog, station_program, ft, radio_begin, radio_end = self._find_program(video_id, station, vid_int)
title = prog.find('title').text
description = clean_html(prog.find('info').text)
st... | @@ -0,0 +1,228 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+)
+from ..compat import compat_urlli... | yt_dlp/extractor/radiko.py | 26 | Python | 0.5 | suggestion | 196 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'timestamp': vid_int,
'formats': formats,
# we have to mark this live since they behave as if it's a live
'is_live': True,
}
class RadikoRadioIE(RadikoBaseIE):
_VALID_URL = r'https?://(?:www\.)?radiko\.jp/#!/live/(?P<id>[A-Z0-9-]+)'
_TESTS = [{
... | Maybe
```suggestion
self.report_warning('Downloader will not stop at the end of the program! Press Ctrl+C to stop')
``` | 'title': title,
'description': description,
'uploader': station_name,
'uploader_id': station,
'timestamp': vid_int,
'formats': formats,
'is_live': True,
}
class RadikoRadioIE(RadikoBaseIE):
_VALID_URL = r'https?://(?:www\.... | @@ -0,0 +1,228 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+import base64
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ update_url_query,
+ clean_html,
+ unified_timestamp,
+)
+from ..compat import compat_urlli... | yt_dlp/extractor/radiko.py | 26 | Python | 1 | suggestion | 131 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
url_attrib = url_tag.attrib
playlist_url = update_url_query(pcu.text, {
'station_id': station,
**query,
'l': '15',
'lsid': '77d0678df93a1034659c14d6fc89f018',
'type': 'b',
})
if playlist_url i... | ```suggestion
# Prioritize live radio vs playback based on extractor
sf['preference'] = 100 if is_onair else -100
``` | url_attrib = url_tag.attrib
playlist_url = update_url_query(pcu.text, {
'station_id': station,
**query,
'l': '15',
'lsid': '77d0678df93a1034659c14d6fc89f018',
'type': 'b',
})
if playlist_url i... | @@ -126,7 +127,6 @@ def _extract_formats(self, video_id, station, is_onair, ft, cursor, auth_token,
if re.match(r'^[cf]-radiko\.smartstream\.ne\.jp$', domain):
sf['preference'] = 100 if is_onair else -100 # current radio stream | yt_dlp/extractor/radiko.py | 26 | Python | 1 | refactor | 160 | 51 | 51 | false | [radiko] add support for radiko.jp | 731 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'uploader': 'Zee Entertainment Enterprises Ltd',
'release_date': '20090101',
'upload_date': '20090101',
'timestamp': 1230768000,
'thumbnail': 'https://akamaividz.zee5.com/resources/0-1-233402/list/270x152/01233402_list.jpg',
'series': 'Krishna Balr... | too much stuff here. vars that is used only once don't need to be properties | 'uploader': 'Zee Entertainment Enterprises Ltd',
'release_date': '20090101',
'upload_date': '20090101',
'timestamp': 1230768000,
'thumbnail': 'https://akamaividz.zee5.com/resources/0-1-233402/list/270x152/01233402_list.jpg',
'series': 'Krishna Balr... | @@ -83,16 +83,48 @@ class Zee5IE(InfoExtractor):
'only_matching': True
}]
_DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails?content_id={}&device_id=iIxsxYf40cqO3koIkwzKHZhnJzHN13zb&platform_name=desktop_web&country=IN&check_parental_control=false'
+ _OTP_REQUEST_URL = 'https://b2... | yt_dlp/extractor/zee5.py | 26 | Python | 0.357 | suggestion | 76 | 51 | 51 | false | Fix Zee5IE and also add Subtitles extraction. | 733 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
raise ExtractorError(otp_request_json['message'], expected=True)
otp_code = self._get_tfa_info('OTP')
otp_verify_json = self._download_json(self._OTP_VERIFY_URL.format(username, otp_code), None, note="Verifying OTP", fatal=False)
if not otp_verify_json... | repeated in 3 places. make this a property | raise ExtractorError(otp_request_json['message'], expected=True)
otp_code = self._get_tfa_info('OTP')
otp_verify_json = self._download_json('https://b2bapi.zee5.com/device/verifyotp_v1.php?phoneno=91{}&otp={}&guest_token={}&platform=web'.format(username, otp_code, sel... | @@ -83,16 +83,48 @@ class Zee5IE(InfoExtractor):
'only_matching': True
}]
_DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails?content_id={}&device_id=iIxsxYf40cqO3koIkwzKHZhnJzHN13zb&platform_name=desktop_web&country=IN&check_parental_control=false'
+ _OTP_REQUEST_URL = 'https://b2... | yt_dlp/extractor/zee5.py | 26 | Python | 0.071 | suggestion | 42 | 51 | 51 | false | Fix Zee5IE and also add Subtitles extraction. | 733 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'episode_number': 1,
'tags': list,
},
'params': {
'format': 'bv',
},
}, {
'url': 'https://www.zee5.com/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730?country=IN',
'only_matching': True
}, ... | ```suggestion
None, note='Sending OTP')
``` | 'episode_number': 1,
'tags': list,
},
'params': {
'format': 'bv',
},
}, {
'url': 'https://www.zee5.com/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730?country=IN',
'only_matching': True
}, ... | @@ -80,53 +82,91 @@ class Zee5IE(InfoExtractor):
'url': 'https://www.zee5.com/global/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730',
'only_matching': True
}]
+ _DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails?content_id={}&dev... | yt_dlp/extractor/zee5.py | 26 | Python | 1 | suggestion | 100 | 51 | 51 | false | Fix Zee5IE and also add Subtitles extraction. | 733 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'url': 'https://www.zee5.com/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730?country=IN',
'only_matching': True
}, {
'url': 'https://www.zee5.com/global/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os77... | ```suggestion
None, note='Verifying OTP', fatal=False)
``` | 'url': 'https://www.zee5.com/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730?country=IN',
'only_matching': True
}, {
'url': 'https://www.zee5.com/global/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os77... | @@ -80,53 +82,91 @@ class Zee5IE(InfoExtractor):
'url': 'https://www.zee5.com/global/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730',
'only_matching': True
}]
+ _DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails?content_id={}&dev... | yt_dlp/extractor/zee5.py | 26 | Python | 1 | suggestion | 114 | 51 | 51 | false | Fix Zee5IE and also add Subtitles extraction. | 733 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
None, note="Sending OTP")
if otp_request_json['code'] == 0:
self.to_screen(otp_request_json['message'])
else:
raise ExtractorError(otp_request_json['message'], expected=True)
ot... | ```suggestion
'x-access-token': access_token_request['token']
``` | None, note='Sending OTP')
if otp_request_json['code'] == 0:
self.to_screen(otp_request_json['message'])
else:
raise ExtractorError(otp_request_json['message'], expected=True)
ot... | @@ -80,53 +82,91 @@ class Zee5IE(InfoExtractor):
'url': 'https://www.zee5.com/global/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730',
'only_matching': True
}]
+ _DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails?content_id={}&dev... | yt_dlp/extractor/zee5.py | 26 | Python | 0.857 | suggestion | 79 | 51 | 51 | false | Fix Zee5IE and also add Subtitles extraction. | 733 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
extract_attributes,
int_or_none,
)
class TV5MondePlusIE(InfoExtractor):
IE_DESC = 'TV5MONDE+'
_VALID_URL = r'https?://(?:www\.)?(?:tv5mondeplus|revoir\.tv5monde)\.com/tou... | why are existing tests being removed? | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
extract_attributes,
int_or_none,
parse_duration,
try_get,
)
class TV5MondePlusIE(InfoExtractor):
IE_DESC = 'TV5MONDE+'
_VALID_URL = r'https?://(?:www\.)?(?:tv5mon... | @@ -15,28 +14,28 @@ class TV5MondePlusIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:tv5mondeplus|revoir\.tv5monde)\.com/toutes-les-videos/[^/]+/(?P<id>[^/?#]+)'
_TESTS = [{
# movie
- 'url': 'https://revoir.tv5monde.com/toutes-les-videos/cinema/rendez-vous-a-atlit',
- 'md5': '8... | yt_dlp/extractor/tv5mondeplus.py | 19 | Python | 0.286 | question | 37 | 44 | 44 | false | [tv5mondeplus] fix download after json format change | 739 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | korli |
video_files = self._parse_json(
vpl_data['data-broadcast'], display_id)
formats = []
for video_file in video_files:
v_url = video_file.get('url')
if not v_url:
continue
video_format = video_file.get('format') or determine_ext(v_url)... | ```suggestion
duration = (int_or_none(try_get(metadata, lambda x: x['content']['duration']))
or parse_duration(self._html_search_meta('duration', webpage)))
```
Unless u have reason to believe otherwise, assume the _html_search_meta fallback exists for a reason | webpage, 'video player loader'))
video_files = self._parse_json(
vpl_data['data-broadcast'], display_id)
formats = []
for video_file in video_files:
v_url = video_file.get('url')
if not v_url:
continue
video_format = vi... | @@ -81,6 +80,14 @@ def _real_extract(self, url):
})
self._sort_formats(formats)
+ metadata = self._parse_json(
+ vpl_data['data-metadata'], display_id)
+ duration = 0
+ if metadata:
+ content = metadata.get('content')
+ if content:
+ ... | yt_dlp/extractor/tv5mondeplus.py | 26 | Python | 1 | suggestion | 293 | 51 | 51 | false | [tv5mondeplus] fix download after json format change | 739 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | korli |
display_id = '{artist:s} - {title:s}'.format(**m.groupdict())
webpage = self._download_webpage(url, display_id)
track_id = self._search_regex(
r'intTrackId\s*=\s*(\d+)', webpage, 'track ID')
payload = urlencode_postdata({'tracks[]': track_id})
req = sanitized_Reques... | this effectively makes all these fatal | thumbnail = data_json.get('artwork_url') or data_json.get('thumb')
view_count = str_to_int(data_json.get('playback_count'))
duration = str_to_int(data_json.get('duration'))
timestamp = data_json.get('release_timestamp')
formats = []
mp3_url = data_json.get('stream_url')
... | @@ -78,27 +78,23 @@ def _real_extract(self, url):
thumbnail = self._og_search_thumbnail(webpage)
meta_span = r'<span[^>]+class="%s".*?</i>([^<]+)</span>'
- view_count = str_to_int(self._search_regex(
- meta_span % 'plays_count', webpage, 'view count', fatal=False))
- like_co... | yt_dlp/extractor/hearthisat.py | 26 | Python | 0.071 | suggestion | 38 | 51 | 44 | false | [HearThisAtIE] Fix extractor. | 742 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
KNOWN_EXTENSIONS,
str_to_int,
)
class HearThisAtIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hearthis\.at/(?P<artist>[^/]+)/(?P<title>[A-Za-z0-9\-]+)/?$'
_PLAYLIST_URL = 'https://hearthis.at/playlist.php'
... | should be `view_count`, `like_count` | import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
KNOWN_EXTENSIONS,
str_to_int,
)
class HearThisAtIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hearthis\.at/(?P<artist>[^/]+)/(?P<title>[A-Za-z0-9\-]+)/?$'
_PLAYLIST_URL = 'https://hearthis.at/playlist.php'
... | @@ -27,13 +23,12 @@ class HearThisAtIE(InfoExtractor):
'title': 'Moofi - Dr. Kreep',
'thumbnail': r're:^https?://.*\.jpg$',
'timestamp': 1421564134,
- 'description': 'md5:a4b6190da9075c89b203ac369f24d66e',
+ 'description': 'md5:1adb0667b01499f9d27e97ddfd53852... | yt_dlp/extractor/hearthisat.py | 26 | Python | 0.5 | suggestion | 36 | 51 | 51 | false | [HearThisAtIE] Fix extractor. | 742 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
})
mvpd_confirm_page, urlh = mvpd_confirm_page_res
if '<button class="submit" value="Resume">Resume</button>' in mvpd_confirm_page:
post_form(mvpd_confirm_page_res, 'Confirming Login')
elif mso_id == ... | > "'N'== \"Y\""
Are you sure this is not a typo?
`"'N'=='Y'"` would make more sense
| })
mvpd_confirm_page, urlh = mvpd_confirm_page_res
if '<button class="submit" value="Resume">Resume</button>' in mvpd_confirm_page:
post_form(mvpd_confirm_page_res, 'Confirming Login')
elif mso_id == ... | @@ -1508,15 +1508,17 @@ def extract_redirect_url(html, url=None, fatal=False):
# In general, if you're connecting from a Verizon-assigned IP,
# you will not actually pass your credentials.
provider_redirect_page, urlh = provider_redirect_page_res
- ... | yt_dlp/extractor/adobepass.py | 26 | Python | 0.357 | nitpick | 89 | 51 | 51 | false | [adobepass] Fix Verizon SAML login error | 743 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | ghost |
mso_info['username_field']: username,
mso_info['password_field']: password,
})
saml_login_page, urlh = saml_login_page_res
if 'Please try again.' in saml_login_page:
... | ```suggestion
saml_login_page, urlh = post_form(
[saml_login_page, saml_redirect_url], 'Logging in', {
mso_info['username_field']: username,
mso_info['password_field']: password,
... | mso_info['username_field']: username,
mso_info['password_field']: password,
})
saml_login_page, urlh = saml_login_page_res
if 'Please try again.' in saml_login_page:
... | @@ -1526,6 +1528,28 @@ def extract_redirect_url(html, url=None, fatal=False):
if 'Please try again.' in saml_login_page:
raise ExtractorError(
'We\'re sorry, but either the User ID or Password entered is not correct.')
+ ... | yt_dlp/extractor/adobepass.py | 26 | Python | 1 | suggestion | 335 | 51 | 51 | false | [adobepass] Fix Verizon SAML login error | 743 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | ghost |
saml_login_page, urlh = saml_login_page_res
if 'Please try again.' in saml_login_page:
raise ExtractorError(
'We\'re sorry, but either the User ID or Password entered is not correct.')
else:
... | ```suggestion
'Failed to login, incorrect User ID or Password.')
``` | saml_login_page, urlh = saml_login_page_res
if 'Please try again.' in saml_login_page:
raise ExtractorError(
'We\'re sorry, but either the User ID or Password entered is not correct.')
else:
... | @@ -1526,6 +1528,28 @@ def extract_redirect_url(html, url=None, fatal=False):
if 'Please try again.' in saml_login_page:
raise ExtractorError(
'We\'re sorry, but either the User ID or Password entered is not correct.')
+ ... | yt_dlp/extractor/adobepass.py | 26 | Python | 1 | bug | 102 | 51 | 51 | false | [adobepass] Fix Verizon SAML login error | 743 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | ghost |
r'self\.parent\.location=(["\'])(?P<url>.+?)\1',
provider_redirect_page,
'SAML Redirect URL', group='url')
saml_login_page = self._download_webpage(
saml_redirect_url, video_id,
... | r u sure there is no better way to do this? | r'self\.parent\.location=(["\'])(?P<url>.+?)\1',
provider_redirect_page,
'SAML Redirect URL', group='url')
saml_login_page = self._download_webpage(
saml_redirect_url, video_id,
... | @@ -1526,6 +1528,27 @@ def extract_redirect_url(html, url=None, fatal=False):
if 'Please try again.' in saml_login_page:
raise ExtractorError(
'We\'re sorry, but either the User ID or Password entered is not correct.')
+ ... | yt_dlp/extractor/adobepass.py | 26 | Python | 0.286 | question | 43 | 51 | 51 | false | [adobepass] Fix Verizon SAML login error | 743 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
})['stream_url']
formats = self._extract_m3u8_formats(
m3u8_url, video_id, ext='mp4', entry_protocol='m3u8_native',
m3u8_id='hls')
self._sort_formats(formats)
info.update({
'id': video_id,
'formats': formats,
})
return... | why is this an empty string? If not found, it should be None | })['stream_url']
formats = self._extract_m3u8_formats(
m3u8_url, video_id, ext='mp4', entry_protocol='m3u8_native',
m3u8_id='hls')
self._sort_formats(formats)
info.update({
'id': video_id,
'formats': formats,
})
return... | @@ -71,14 +74,14 @@ class HungamaSongIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hungama\.com/song/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'https://www.hungama.com/song/kitni-haseen-zindagi/2931166/',
- 'md5': 'a845a6d1ebd08d80c1035126d49bd6a0',
+ 'md5': 'd4a6a05a394ad0453a9bea3ca0... | yt_dlp/extractor/hungama.py | 26 | Python | 0.357 | question | 60 | 51 | 51 | false | Fix HungamaSongIE and Add HungamaAlbumPlaylistIE. | 744 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
class HungamaAlbumPlaylistIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hungama\.com/(?:playlists|album)/[^/]+/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.hungama.com/album/bhuj-the-pride-of-india/69481490/',
'playlist_mincount': 7,
'info_dict': {
'id': '69481490',
... | ```suggestion
self.url_result(item, ie=HungamaSongIE.ie_key())
``` | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
try_get,
urlencode_postdata,
)
class HungamaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:www\.)?hungama\.com/
... | @@ -115,3 +120,32 @@ def _real_extract(self, url):
'release_year': int_or_none(data.get('date')),
'formats': formats,
}
+
+
+class HungamaAlbumPlaylistIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?hungama\.com/(?:playlists|album)/[^/]+/(?P<id>\d+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/hungama.py | 26 | Python | 0.857 | suggestion | 80 | 29 | 148 | false | Fix HungamaSongIE and Add HungamaAlbumPlaylistIE. | 744 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
def _real_extract(self, url):
id = self._match_id(url)
webpage = self._download_webpage(url, id)
user_id = re.search(r'\"id\":\"(?P<userid>\d+)', webpage)
if not user_id:
raise ExtractorError('Cookies are required to download from TikTok user account.', expected=True)
... | ```suggestion
entries.append(self.url_result('https://www.tiktok.com/@%s/video/%s' % (id, video_id),
ie=TikTokIE.ie_key(), video_id=video_id))
``` | 'extractor': 'TikTok',
'url': download_url,
'ext': 'mp4',
'height': height,
'width': width,
'title': str_or_none(video.get('desc')),
'duration': try_get(video, lambda x: x['video']... | @@ -150,3 +152,52 @@ def _real_extract(self, url):
raise ExtractorError('This video is private', expected=True)
raise ExtractorError('Video not available', video_id=video_id)
+
+
+class TikTokUserIE(InfoExtractor):
+ IE_NAME = 'tiktok:user'
+ _VALID_URL = r'(?!.*/video/)https?://www\.tikto... | yt_dlp/extractor/tiktok.py | 26 | Python | 1 | suggestion | 212 | 29 | 31 | false | Add TikTokUserIE. | 756 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
video_id = video['id']
video_url = f'https://www.tiktok.com/@{user_id}/video/{video_id}'
download_url = try_get(video, (lambda x: x['video']['playAddr'],
lambda x: x['video']['downloadAddr']))
thumbnail = try_... | ```suggestion
'uploader_url': f'https://www.tiktok.com/@{user_id}',
``` | video_url = f'https://www.tiktok.com/@{user_id}/video/{video_id}'
download_url = try_get(video, (lambda x: x['video']['playAddr'],
lambda x: x['video']['downloadAddr']))
thumbnail = try_get(video, lambda x: x['video']['origin... | @@ -127,3 +128,79 @@ def _real_extract(self, url):
raise ExtractorError('This video is private', expected=True)
raise ExtractorError('Video not available', video_id=video_id)
+
+
+class TikTokUserIE(InfoExtractor):
+ IE_NAME = 'tiktok:user'
+ _VALID_URL = r'(?!.*/video/)https?://www\.tikto... | yt_dlp/extractor/tiktok.py | 26 | Python | 0.857 | suggestion | 93 | 41 | 40 | false | Add TikTokUserIE. | 756 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
},
'params': {
# m3u8 download
'skip_download': True,
},
}, {
# multiple Youtube embeds
'url': 'https://www.mtvuutiset.fi/artikkeli/50-vuotta-subarun-vastaiskua/6070962',
'only_matching': True,
}]
def _real_extract(self, url):
... | ```suggestion
if not data.get('drmProtected'):
formats.extend(self._extract_m3u8_formats(
video_url, video_id, 'mp4', live=is_live,
m3u8_id=format_id, fatal=False))
```
Also, I don't think the DRM check is needed... | raise
items = try_get(data, lambda x: x['items']['item'])
if not items:
continue
if not isinstance(items, list):
items = [items]
for item in items:
if not isinstance(item, dict):
continue
... | @@ -203,6 +192,93 @@ class KatsomoIE(TV2IE):
_PROTOCOLS = ('HLS', 'MPD')
_GEO_COUNTRIES = ['FI']
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ api_base = 'http://%s/api/web/asset/%s' % (self._API_DOMAIN, video_id)
+
+ asset = self._download_json(
+ api... | yt_dlp/extractor/tv2.py | 26 | Python | 1 | refactor | 325 | 29 | 51 | false | Fix TV2IE | 766 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
float_or_none,
js_to_json,
parse_iso8601,
remove_end,
strip_or_none,
try_get,
... | shouldnt be needed due to #729 | continue
format_urls.append(video_url)
ext = determine_ext(video_url)
if ext == 'f4m':
formats.extend(self._extract_f4m_formats(
video_url, video_id, f4m_id=format_id, fatal=False))
elif ext =... | @@ -203,6 +192,93 @@ class KatsomoIE(TV2IE):
_PROTOCOLS = ('HLS', 'MPD')
_GEO_COUNTRIES = ['FI']
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ api_base = 'http://%s/api/web/asset/%s' % (self._API_DOMAIN, video_id)
+
+ asset = self._download_json(
+ api... | yt_dlp/extractor/tv2.py | 26 | Python | 0.286 | suggestion | 31 | 249 | 51 | false | Fix TV2IE | 766 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
float_or_none,
js_to_json,
parse_iso8601,
remove_end,
strip_or_none,
try_get,
... | ```suggestion
} for thumbnail in (asset.get('imageVersions') or {}).values()]
``` | elif ext == 'm3u8':
if not data.get('drmProtected'):
formats.extend(self._extract_m3u8_formats(
video_url, video_id, 'mp4',
'm3u8' if is_live else 'm3u8_native',
m3u8_id=format... | @@ -203,6 +192,93 @@ class KatsomoIE(TV2IE):
_PROTOCOLS = ('HLS', 'MPD')
_GEO_COUNTRIES = ['FI']
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ api_base = 'http://%s/api/web/asset/%s' % (self._API_DOMAIN, video_id)
+
+ asset = self._download_json(
+ api... | yt_dlp/extractor/tv2.py | 26 | Python | 0.857 | suggestion | 91 | 249 | 51 | false | Fix TV2IE | 766 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'url': 'https://www.mtv.fi/sarja/mtv-uutiset-live-33001002003/lahden-pelicans-teki-kovan-ratkaisun-ville-nieminen-pihalle-1181321',
'info_dict': {
'id': '1181321',
'ext': 'mp4',
'title': 'Lahden Pelicans teki kovan ratkaisun – Ville Nieminen pihalle',
'des... | ```suggestion
asset = self._download_json(
f'{api_base}.json', video_id, 'Downloading metadata JSON')['asset']
``` | },
'params': {
# m3u8 download
'skip_download': True,
},
}, {
'url': 'http://www.katsomo.fi/#!/jakso/33001005/studio55-fi/658521/jukka-kuoppamaki-tekee-yha-lauluja-vaikka-lentokoneessa',
'only_matching': True,
}, {
'url': 'https://www.mtvuu... | @@ -203,6 +192,93 @@ class KatsomoIE(TV2IE):
_PROTOCOLS = ('HLS', 'MPD')
_GEO_COUNTRIES = ['FI']
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ api_base = 'http://%s/api/web/asset/%s' % (self._API_DOMAIN, video_id)
+
+ asset = self._download_json(
+ api... | yt_dlp/extractor/tv2.py | 26 | Python | 1 | suggestion | 137 | 51 | 51 | false | Fix TV2IE | 766 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'view_count': int,
'categories': list,
},
'params': {
# m3u8 download
'skip_download': True,
},
}, {
'url': 'http://www.katsomo.fi/#!/jakso/33001005/studio55-fi/658521/jukka-kuoppamaki-tekee-yha-lauluja-vaikka-lentokoneessa',
'o... | ```suggestion
f'{api_base}/play.json?protocol={protocol}&videoFormat=SMIL+ISMUSP',
``` | 'url': 'https://www.mtvuutiset.fi/video/prog1311159',
'only_matching': True,
}, {
'url': 'https://www.katsomo.fi/#!/jakso/1311159',
'only_matching': True,
}]
_API_DOMAIN = 'api.katsomo.fi'
_PROTOCOLS = ('HLS', 'MPD')
_GEO_COUNTRIES = ['FI']
def _real_extract(self... | @@ -203,6 +192,93 @@ class KatsomoIE(TV2IE):
_PROTOCOLS = ('HLS', 'MPD')
_GEO_COUNTRIES = ['FI']
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ api_base = 'http://%s/api/web/asset/%s' % (self._API_DOMAIN, video_id)
+
+ asset = self._download_json(
+ api... | yt_dlp/extractor/tv2.py | 26 | Python | 1 | suggestion | 108 | 51 | 51 | false | Fix TV2IE | 766 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class ManotoTVIE(InfoExtractor):
IE_NAME = 'Manoto TV (Episode / Video)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://www.manototv.com/episode/12576',
... | the site doesn't have individual videos?
If it does then add to tests if it doesn't then remove ` / Video` from IE name | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
traverse_obj
)
_API_URL = 'https://dak1vd5vmi7x6.cloudfront.net/api/v1/publicrole/{}/{}?id={}'
class ManotoTVIE(InfoExtractor):
IE_DESC = 'Manoto TV (Episode)'
... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)' | yt_dlp/extractor/manoto.py | 17 | Python | 0.714 | suggestion | 120 | 42 | 42 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
'title': 'فیلم های ایرانی',
'description': 'مجموعه ای از فیلم های سینمای کلاسیک ایران',
# 'thumbnail': r're:^https?://.*\.png$',
},
}]
def _real_extract(self, url):
show_id = self._match_id(url)
show_json = self._download_json('https://dak1vd5vmi7x6.c... | extract show title, id, ep number etc aswell
| },
'params': {
'skip_download': 'm3u8',
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
episode_json = self._download_json(_API_URL.format('showmodule', 'episodedetails', video_id), video_id)
details = episode_json.get('details', {})... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.286 | refactor | 46 | 51 | 51 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class ManotoTVIE(InfoExtractor):
IE_NAME = 'Manoto TV (Episode / Video)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://www.manototv.com/episode/12576',
... | don't call it `json`
Will cause confusion
rename it to `data_json` or `video_json` or `episode_json` | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
traverse_obj
)
_API_URL = 'https://dak1vd5vmi7x6.cloudfront.net/api/v1/publicrole/{}/{}?id={}'
class ManotoTVIE(InfoExtractor):
IE_DESC = 'Manoto TV (Episode)'
... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 23 | Python | 0.714 | suggestion | 102 | 48 | 48 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
from .common import InfoExtractor
class ManotoTVIE(InfoExtractor):
IE_NAME = 'Manoto TV (Episode / Video)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://www.manototv.com/episode/12576',
'info_dict': {
'id': '12576',
... | remove `''` from .get
Default should be `None` so u don't have to put anything there |
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
traverse_obj
)
_API_URL = 'https://dak1vd5vmi7x6.cloudfront.net/api/v1/publicrole/{}/{}?id={}'
class ManotoTVIE(InfoExtractor):
IE_DESC = 'Manoto TV (Episode)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/episod... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.571 | suggestion | 85 | 51 | 51 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
from .common import InfoExtractor
class ManotoTVIE(InfoExtractor):
IE_NAME = 'Manoto TV (Episode / Video)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://www.manototv.com/episode/12576',
'info_dict': {
'id': '12576',
... | are u sure the ext is m3u8 and not mp4/mkv/anything else? | from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
traverse_obj
)
_API_URL = 'https://dak1vd5vmi7x6.cloudfront.net/api/v1/publicrole/{}/{}?id={}'
class ManotoTVIE(InfoExtractor):
IE_DESC = 'Manoto TV (Episode)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/episode... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.143 | question | 57 | 51 | 51 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
def _real_extract(self, url):
show_id = self._match_id(url)
show_json = self._download_json('https://dak1vd5vmi7x6.cloudfront.net/api/v1/publicrole/showmodule/details?id=' + show_id, show_id)
show_details = show_json.get('details', {})
title = show_details.get('showTitle', '')
... | same, if it does have playlists then add to test else remove it from IE name |
def _real_extract(self, url):
video_id = self._match_id(url)
episode_json = self._download_json(_API_URL.format('showmodule', 'episodedetails', video_id), video_id)
details = episode_json.get('details', {})
formats = self._extract_m3u8_formats(details.get('videoM3u8Url'), video_id, ... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.357 | suggestion | 76 | 50 | 51 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
video_url = details.get('videoM3u8Url', '')
description = details.get('showSynopsis', '')
thumbnail = details.get('episodelandscapeImgIxUrl', '')
ext = 'm3u8'
formats = self._extract_m3u8_formats(video_url, video_id, ext)
return {
'id': video_id,
'... | remove comment if u are not going to extract it | 'duration': 3600,
'categories': ['سرگرمی'],
'title': 'کارول و جان',
'description': 'md5:d0fff1f8ba5c6775d312a00165d1a97e',
'thumbnail': r're:^https?://.*\.(jpeg|png|jpg)$',
'ext': 'mp4'
},
'params': {
'skip_download': 'm... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.286 | refactor | 47 | 51 | 51 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
'ext': ext,
'formats': formats,
}
class ManotoTVShowIE(InfoExtractor):
IE_NAME = 'Manoto TV (Show / Playlist)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/show/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.manototv.com/show/2526',
'playlist_mincount': ... | same, remove this if not extracting | }, {
'url': 'https://www.manototv.com/episode/12576',
'info_dict': {
'id': '12576',
'series': 'فیلم های ایرانی',
'episode_id': 'Seh Mah Taatili',
'duration': 5400,
'view_count': int,
'categories': ['سرگرمی'],
'title'... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.286 | refactor | 35 | 51 | 51 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class ManotoTVIE(InfoExtractor):
IE_NAME = 'Manoto TV (Episode / Video)'
_VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://www.manototv.com/episode/12576',
... | no way extract a proper id?
This might cause issues with download archive.
| show_id = self._match_id(url)
show_json = self._download_json(_API_URL.format('showmodule', 'details', show_id), show_id)
show_details = show_json.get('details', {})
title = show_details.get('showTitle')
description = show_details.get('showSynopsis')
series_json = self._... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.357 | refactor | 77 | 103 | 49 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
entries = [
self.url_result(
'https://www.manototv.com/episode/%s' % item['slideID'], ie=ManotoTVIE.ie_key(), video_id=item['slideID'])
for item in playlist]
return self.playlist_result(entries, show_id, title, description)
class ManotoTVLiveIE(InfoExtractor):
... | make sure the extension is really m3u8 | 'title': details.get('episodeTitle'),
'description': clean_html(details.get('episodeDescription')),
'thumbnail': details.get('episodelandscapeImgIxUrl'),
'formats': formats,
}
class ManotoTVShowIE(InfoExtractor):
IE_DESC = 'Manoto TV (Show)'
_VALID_URL =... | @@ -0,0 +1,102 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class ManotoTVIE(InfoExtractor):
+ IE_NAME = 'Manoto TV (Episode / Video)'
+ _VALID_URL = r'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'https://www.man... | yt_dlp/extractor/manoto.py | 26 | Python | 0.071 | suggestion | 38 | 34 | 51 | false | [Manoto TV] Add new extractor | 767 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | tandy-1000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.