mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 07:51:26 +01:00
Compare commits
4 Commits
7891a61616
...
915029a657
Author | SHA1 | Date | |
---|---|---|---|
|
915029a657 | ||
|
52b6b71d78 | ||
|
f36a85b5b0 | ||
|
33d5b0ef5a |
|
@ -3,11 +3,11 @@ import re
|
|||
from .common import InfoExtractor
|
||||
from .archiveorg import ArchiveOrgIE
|
||||
from ..utils import (
|
||||
int_or_none,
|
||||
str_to_int,
|
||||
orderedSet,
|
||||
urljoin,
|
||||
InAdvancePagedList,
|
||||
int_or_none,
|
||||
orderedSet,
|
||||
str_to_int,
|
||||
urljoin,
|
||||
)
|
||||
|
||||
|
||||
|
@ -39,14 +39,21 @@ class AltCensoredIE(InfoExtractor):
|
|||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
yt_views = str_to_int(self._html_search_regex(r'YouTube Views:(?:\s| )*([\d,]+)', webpage, 'view count', default=''))
|
||||
category = self._html_search_regex(r'<a href="/category/\d+">\s*\n?\s*([^<]+)</a>', webpage, 'category', fatal=False)
|
||||
|
||||
return self.url_result(f'https://archive.org/details/youtube-{video_id}', ArchiveOrgIE, url_transparent=True,
|
||||
view_count=yt_views, categories=[category])
|
||||
return {
|
||||
'_type': 'url_transparent',
|
||||
'url': f'https://archive.org/details/youtube-{video_id}',
|
||||
'ie_key': ArchiveOrgIE.ie_key(),
|
||||
'view_count': str_to_int(self._html_search_regex(
|
||||
r'YouTube Views:(?:\s| )*([\d,]+)', webpage, 'view count', default=None))
|
||||
'categories': self._html_search_regex(
|
||||
r'<a href="/category/\d+">\s*\n?\s*([^<]+)</a>',
|
||||
webpage, 'category', default='').split() or None
|
||||
}
|
||||
|
||||
|
||||
class AltCensoredChannelIE(InfoExtractor):
|
||||
IE_NAME = 'altcensored:channel'
|
||||
_VALID_URL = r'https?://(?:www\.)?altcensored\.com/channel/(?!page|table)(?P<id>[^/?#]+)'
|
||||
_PAGE_SIZE = 24
|
||||
_TESTS = [{
|
||||
|
|
Loading…
Reference in New Issue
Block a user