mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-23 10:51:24 +02:00
Compare commits
3 Commits
915029a657
...
9ea2a132eb
Author | SHA1 | Date | |
---|---|---|---|
|
9ea2a132eb | ||
|
61a7428540 | ||
|
93dd460668 |
|
@ -1,7 +1,7 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from .archiveorg import ArchiveOrgIE
|
from .archiveorg import ArchiveOrgIE
|
||||||
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
InAdvancePagedList,
|
InAdvancePagedList,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
@ -45,10 +45,10 @@ class AltCensoredIE(InfoExtractor):
|
||||||
'url': f'https://archive.org/details/youtube-{video_id}',
|
'url': f'https://archive.org/details/youtube-{video_id}',
|
||||||
'ie_key': ArchiveOrgIE.ie_key(),
|
'ie_key': ArchiveOrgIE.ie_key(),
|
||||||
'view_count': str_to_int(self._html_search_regex(
|
'view_count': str_to_int(self._html_search_regex(
|
||||||
r'YouTube Views:(?:\s| )*([\d,]+)', webpage, 'view count', default=None))
|
r'YouTube Views:(?:\s| )*([\d,]+)', webpage, 'view count', default=None)),
|
||||||
'categories': self._html_search_regex(
|
'categories': self._html_search_regex(
|
||||||
r'<a href="/category/\d+">\s*\n?\s*([^<]+)</a>',
|
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):
|
def _real_extract(self, url):
|
||||||
channel_id = self._match_id(url)
|
channel_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(
|
||||||
webpage = self._download_webpage(url, channel_id, note='Download channel info',
|
url, channel_id, 'Download channel webpage', 'Unable to get channel webpage')
|
||||||
errnote='Unable to get channel info')
|
|
||||||
title = self._html_search_meta('altcen_title', webpage, 'title', fatal=False)
|
title = self._html_search_meta('altcen_title', webpage, 'title', fatal=False)
|
||||||
page_count = int_or_none(self._html_search_regex(
|
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):
|
def page_func(page_num):
|
||||||
page_num += 1
|
page_num += 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user