Compare commits

..

4 Commits

Author SHA1 Message Date
Raphaël Droz
915029a657
Update yt_dlp/extractor/altcensored.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2023-11-15 21:03:41 -03:00
Raphaël Droz
52b6b71d78
Update yt_dlp/extractor/altcensored.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2023-11-15 21:03:14 -03:00
Raphaël Droz
f36a85b5b0
Update yt_dlp/extractor/altcensored.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2023-11-15 21:02:58 -03:00
Raphaël Droz
33d5b0ef5a
Update yt_dlp/extractor/altcensored.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2023-11-15 21:01:50 -03:00

View File

@ -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|&nbsp;)*([\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|&nbsp;)*([\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 = [{