Compare commits

...

3 Commits

Author SHA1 Message Date
bashonly
9ea2a132eb
fixing my typo 2023-11-16 00:46:00 +00:00
Raphaël Droz
61a7428540
Update yt_dlp/extractor/altcensored.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2023-11-15 21:05:43 -03:00
Raphaël Droz
93dd460668
Update yt_dlp/extractor/altcensored.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2023-11-15 21:04:33 -03:00

View File

@ -1,7 +1,7 @@
import re
from .common import InfoExtractor
from .archiveorg import ArchiveOrgIE
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
int_or_none,
@ -45,10 +45,10 @@ class AltCensoredIE(InfoExtractor):
'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))
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
webpage, 'category', default='').split() or None,
}
@ -74,12 +74,12 @@ class AltCensoredChannelIE(InfoExtractor):
def _real_extract(self, url):
channel_id = self._match_id(url)
webpage = self._download_webpage(url, channel_id, note='Download channel info',
errnote='Unable to get channel info')
webpage = self._download_webpage(
url, channel_id, 'Download channel webpage', 'Unable to get channel webpage')
title = self._html_search_meta('altcen_title', webpage, 'title', fatal=False)
page_count = int_or_none(self._html_search_regex(
r'<a[^>]+href="/channel/\w+/page/(\d+)">(?:\1)</a>', webpage, 'page count', default='1'))
r'<a[^>]+href="/channel/\w+/page/(\d+)">(?:\1)</a>',
webpage, 'page count', default='1'))
def page_func(page_num):
page_num += 1