chandler-stimson / live-stream-downloader

Download M3U8 live streams to the local disk
https://webextension.org/listing/hls-downloader.html
201 stars 70 forks source link

Download .vtt or .srt subtitle files from sites (Feature Request) #25

Closed NebularNerd closed 1 year ago

NebularNerd commented 1 year ago

Loving the plugin, far easier to use than the big well know one as it actually works on most sites. 🙂

A small feature request if possible. Some site serve up .vtt or .srt subtitles but they are either difficult or nigh on impossible to download. I've seen your app pull up subtitles for a couple of site but not all. Would it be possible for you to add the ability to sniff out XHR requested .vtt and .srt files and add them to the download list?

NebularNerd commented 1 year ago

Thanks for the speedy update, I just grabbed the code and tested and unfortunately on the site I really wanted it for still does not work. I think this could be because it uses JWPlayer so maybe the way it calls the .vtt's is not in a straightforward way. Happy to paste a link (or email if you prefer to not have links to stuff on GitHub)

uBlock can see the streams in it's logger but I think they are called by vttparser.js Screenshot 2022-10-05 123139

chandler-stimson commented 1 year ago

Does changing the

types: ['other']

to

types: ['xmlhttprequest', 'other']

help?

https://github.com/chandler-stimson/live-stream-downloader/blob/master/v3/worker.js#L143

NebularNerd commented 1 year ago

Partially, it grabs a random selection of .vtt's on every refresh. Screenshot 2022-10-05 132340 Screenshot 2022-10-05 132634

chandler-stimson commented 1 year ago

It must grab all the links that are displayed in the uBlock list. If not, please share a sample page, and I'll take a look.

Email: https://add0n.com/hls-downloader.html -> contact developer

NebularNerd commented 1 year ago

email on the way.

chandler-stimson commented 1 year ago

I tried the page, but it does not load the player. I guess the website is Geo-restricted.

Anyhow, you can insert a console.log(d) after Line 73 to see if the links are detected or not. Also, I would recommend trying the extension on a clean profile. Maybe the website has a worker that caches visited links.

NebularNerd commented 1 year ago

console.log(d)

Tricky, the site I mailed you has a nasty script that detects you opening dev tools to read the console, as soon as you do it loads to another page and refuses to play nice until you shut the console.

I've been trying to find a way to dump the log to a text file but most need you to link or import another .js which chrome does not allow.

chandler-stimson commented 1 year ago

I meant the terminal for this extension: chrome://extensions/ -> inspect -> Console tab

chandler-stimson commented 1 year ago

You nee to enable the "Developer mode".

NebularNerd commented 1 year ago

I meant the terminal for this extension: chrome://extensions/ -> inspect -> Console tab Gotcha.

Good news!!!! 🙂

I just reloaded the page and all the .vtt's were detected. Your guess about the cache is correct, now getting about 20 hits per page. This is great, some shows the only subs that match up are the ones with the player, if you try using them from opensubtitles or elsewhere they don't always line up.

Screenshot 2022-10-06 100503 Screenshot 2022-10-06 100549

candrapersada commented 4 weeks ago

How to choose language subtitles? image

NebularNerd commented 4 weeks ago

@candrapersada Normally the list of .vtt files will be the same as the list in the player's subtitle selection, for example:

It's not a given though, in some cases you'll have to download all the .vtt's and find the right one.