Open JoseLingo opened 2 years ago
Looks like it would need yt-dl to implement PrivacyPass, as the site implements a Cloudflare/hcaptcha block against non-JS clients (plus points for using hcaptcha instead of G recaptcha, though).
Once you can download the page without JS, have something like this in a new extractor/documaniatv.py
:
# code header boilerplate and imports as required
class DocumaniaTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www.)?documaniatv\.com/[\w/-]+\w-video_(?P<id>[a-f\d]+)\.html'
def _real_extract(self, url):
video_id = self._match_id(url)
# insert magic PrivacyPass or other hack to bypass Cloudflare site breakage here
webpage = self._download_webpage(url, video_id)
video_data = self._search_regex(
r'(?s)jwplayer\s*\(\s*"%s"\s*\)\s*\.\s*setup\s*\(\s*({.+?})\s*\)\s*;' % video_id,
webpage, 'jwplayer data')
video_data = self._parse_json(video_data, video_id)
video_url = video_data['file']
title = self._og_search_title(webpage)
return {
'id': video_id,
'url': video_url,
'title': title,
'thumbnail': self._og_search_thumbnail(webpage),
'width': int_or_none(self._og_search_property('video:width', webpage, fatal=False)),
'height': int_or_none(self._og_search_property('video:height', webpage, fatal=False)),
'duration': int_or_none(self._og_search_property('video:duration', webpage, fatal=False)),
}
for this test link - https://www.documaniatv.com/naturaleza/japon-salvaje-2-las-islas-del-sureste-video_2746bf479.html if you have a browser addon that allows right click, just right click on the video and select save as and you can download the video as mp4
Wow many thanks everyone!!! It works like a charm
https://www.documaniatv.com/ not supported
Example url: https://www.documaniatv.com/naturaleza/japon-salvaje-2-las-islas-del-sureste-video_2746bf479.html Example url: https://www.documaniatv.com/viajes/las-islas-griegas-con-julia-bradbury-4-las-esporadas-video_12f770b7a.html