Open artquest opened 9 months ago
Looks like it is supported by yt-dlp:
--add-header "Referer:URL"
so we would just have to add a gui for it.
But it’s really weird, surely when you open the page in the browser directly the referrer is also not set right? Would you mind sharing the sites and have you tried adding the cookies instead
Thank you, yes, it would be nice to have such an option in GUI.
I've tried to save and use cookies.txt but to no avail. Perhaps it's because the file is hosted on a third-party site: main page with iframe → third-party hosting → yet another hosting.
Here is the sample redacted (NSFW), Server 2, and the direct redacted to m3u8 (403). And when I looked at the m3u8 headers via DevTools (while on the main video page) there is a referer pointing to the same site.
I see - from what I can see neither page is supported by yt-dlp - so it will use a generic extractor. For m3u8 links it will just grab the formats from the container, for html pages it attempts to find video links on the page. So in the terminal
yt-dlp https://yourSecondLink.m3u8 --add-header "Referer:https://yourFirstLink/foo"
should work. So in this gui you would then have to go into that new setting, add the Referer header and then you could use this exact m3u8 link. I feel like doing this for every video would not be much more comfortable than using the command line, but probably for other pages it makes sense to make headers option available.
Ideally you would not have to copy the m3u8 link from the devtools to do that though. So for you page, consider adding an extractor to yt-dlp: https://github.com/yt-dlp/yt-dlp/tree/master/yt_dlp/extractor that would get the m3u8 link from the first link and add the referrer automatically when accessing the second link.
Keep in mind that yt-dlp rejects extractors for piracy sites, not sure if yours qualifies as such - just to be on the safe site i removed the urls from your comment again.
Hi, is it possible somehow to add a referer while downloading a video? Some sites return 403 without it.