3 from .archiveorg
import ArchiveOrgIE
4 from .common
import InfoExtractor
15 class AltCensoredIE(InfoExtractor
):
16 IE_NAME
= 'altcensored'
17 _VALID_URL
= r
'https?://(?:www\.)?altcensored\.com/(?:watch\?v=|embed/)(?P<id>[^/?#]+)'
19 'url': 'https://www.altcensored.com/watch?v=k0srjLSkga8',
21 'id': 'youtube-k0srjLSkga8',
23 'title': "QUELLES SONT LES CONSÉQUENCES DE L'HYPERSEXUALISATION DE LA SOCIÉTÉ ?",
24 'display_id': 'k0srjLSkga8.webm',
25 'release_date': '20180403',
26 'creators': ['Virginie Vota'],
28 'upload_date': '20230318',
29 'uploader': 'admin@altcensored.com',
30 'description': 'md5:0b38a8fc04103579d5c1db10a247dc30',
31 'timestamp': 1679161343,
32 'track': 'k0srjLSkga8',
34 'thumbnail': 'https://archive.org/download/youtube-k0srjLSkga8/youtube-k0srjLSkga8.thumbs/k0srjLSkga8_000925.jpg',
36 'categories': ['News & Politics'],
40 def _real_extract(self
, url
):
41 video_id
= self
._match
_id
(url
)
42 webpage
= self
._download
_webpage
(url
, video_id
)
43 category
= clean_html(self
._html
_search
_regex
(
44 r
'<a href="/category/\d+">([^<]+)</a>', webpage
, 'category', default
=None))
47 '_type': 'url_transparent',
48 'url': f
'https://archive.org/details/youtube-{video_id}',
49 'ie_key': ArchiveOrgIE
.ie_key(),
50 'view_count': str_to_int(self
._html
_search
_regex
(
51 r
'YouTube Views:(?:\s| )*([\d,]+)', webpage
, 'view count', default
=None)),
52 'categories': [category
] if category
else None,
56 class AltCensoredChannelIE(InfoExtractor
):
57 IE_NAME
= 'altcensored:channel'
58 _VALID_URL
= r
'https?://(?:www\.)?altcensored\.com/channel/(?!page|table)(?P<id>[^/?#]+)'
61 'url': 'https://www.altcensored.com/channel/UCFPTO55xxHqFqkzRZHu4kcw',
63 'title': 'Virginie Vota',
64 'id': 'UCFPTO55xxHqFqkzRZHu4kcw',
68 'url': 'https://altcensored.com/channel/UC9CcJ96HKMWn0LZlcxlpFTw',
70 'title': 'yukikaze775',
71 'id': 'UC9CcJ96HKMWn0LZlcxlpFTw',
75 'url': 'https://altcensored.com/channel/UCfYbb7nga6-icsFWWgS-kWw',
77 'title': 'Mister Metokur',
78 'id': 'UCfYbb7nga6-icsFWWgS-kWw',
80 'playlist_count': 121,
83 def _real_extract(self
, url
):
84 channel_id
= self
._match
_id
(url
)
85 webpage
= self
._download
_webpage
(
86 url
, channel_id
, 'Download channel webpage', 'Unable to get channel webpage')
87 title
= self
._html
_search
_meta
('altcen_title', webpage
, 'title', fatal
=False)
88 page_count
= int_or_none(self
._html
_search
_regex
(
89 r
'<a[^>]+href="/channel/[\w-]+/page/(\d+)">(?:\1)</a>',
90 webpage
, 'page count', default
='1'))
92 def page_func(page_num
):
94 webpage
= self
._download
_webpage
(
95 f
'https://altcensored.com/channel/{channel_id}/page/{page_num}',
96 channel_id
, note
=f
'Downloading page {page_num}')
98 items
= re
.findall(r
'<a[^>]+href="(/watch\?v=[^"]+)', webpage
)
99 return [self
.url_result(urljoin('https://www.altcensored.com', path
), AltCensoredIE
)
100 for path
in orderedSet(items
)]
102 return self
.playlist_result(
103 InAdvancePagedList(page_func
, page_count
, self
._PAGE
_SIZE
),
104 playlist_id
=channel_id
, playlist_title
=title
)