ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.34k stars 9.95k forks source link

Add support for innlandetfylke.no (videohost: CompanyCast) #32656

Open mrmidlmv opened 9 months ago

mrmidlmv commented 9 months ago

Checklist

Example URLs

Description

WRITE DESCRIPTION HERE

This website is from the goverment region Innlandet in Norway and used for distribution of political meetings. The content is not under copyright and does not require login credentials.

The videos are hosted with CompanyCast. The videoes are embedded on the website. When going to the parent level and copying the url from clipboard the domain host link is given. At this time youtube-dl errors with "Unsupported URL"

The direct videolink is given in the info.json file under "vod_m3u8". For the example video. The link is given as: \/\/cdn.companycast.live\/https\/companycast.live\/files\/priv\/videos\/133126\/edited-2023-10-26_07-22-03.mp4\/index.m3u8.

dirkf commented 9 months ago

So when the ancient Norwegians used to visit neighbouring countries and didn't get the respect they expected, or anyway, they were prone to slice open the guy's chest and spread his lungs out in what they saw as the form of an eagle. The developers of these sites deserve similar treatment: it's almost as if they're trying to hide local government business from the voters. I think the way to handle these pages in yt-dl is:

To start with there are some useful HTML meta elements. But later in the JS we have var app = {...} where the data member of app is an extensive JSON object containing the vod_m3u8 and a lot of metadata, including chapters and participants. The info.json as mentioned (in this case https://cdn.companycast.live/http/companycast.live/player/5e19lmwj/info.json) is also listed, as dataUrl, but its content repeats the other members of the data object.

So finally, return an info_dict with the formats and metadata extracted from the data object.