Twitch
Robert J.
2021-06-29/13:26
Dear Sebaro,

Is it possible to add twitch.com to SaveTube?

As, for example: https://www.twitch.tv/videos/1068412404

Thanks.

sebaro
2021-06-29/22:18
It's more complicated than YouTube, also it has only HLS so you'll have to use an external tool for downloading. Try youtube-dl.

Robert J.
2021-06-30/00:51
Thanks much, but I had looked into youtube-dl when you suggested it on an earlier occasion, and it's just to complicated for me. Just knowing where my limits are.

sebaro
2021-06-30/09:09
Find video format:
youtube-dl -F <VIDEOURL>
Download:
youtube-dl -f <FORMAT> <VIDEOURL>

Robert J.
2021-07-01/00:19
Very kind of you, it looks really easy, but it implies that youtube-dl is installed, not? What happened some time ago when you suggested it was that attempting to install it took about half a day with the Terminal churning non-stop, only for the whole process to end up with an error. If I remember correctly, this error was related to my OS being too old. And there's nothing I can do about that.

sebaro
2021-07-01/08:46

Robert J.
2021-07-02/00:13
As a matter of fact, yes. I have MacPorts installed, and that's were it ended up with an error. But you know — not intending in the least to dismiss your efforts (I use SaveTube 10-20 times in the course of a day, and I have thanked you many times for your work) — there is something called burn-out: after almost four decades setting up quantities of GUI's I'm at a point where I just like things to work without breaking my head over things I don't and never will understand. I'm sure you can relate to this.

sebaro
2021-07-02/18:51
Can you use ffmpeg or other video tool that support hls?

Robert J.
2021-07-03/13:27
For videos I normally use QT Player, QT Player 7 Pro or VLC. I also have installed Handbrake 0.9.9, MPlayer Extended rev14, VCD and MPEG Tools v.1 but I never use them (I suppose RealPlayer can be ignored). But “ffmpeg” said something to me, and a disk search gave something related to it in the MacPorts installation, and also something related to Audacity (which I have installed but as far as I know is only for processing audio, not video — correct me if I'm wrong).

I also found a disk image of ffmpeg v.0.6.2 "for Audacity" from 2011, another one v.0.0.9y from 2016 (about when my OS stopped getting updated) as well as some “binaries” from 2006. As far as I can see I have never installed any of them.

Does this bring us anywhere? I don't know what "hls" is, found three entries that might be related on Wikipedia, but then...? Please keep in mind that I am only a so-called end-user.

sebaro
2021-07-04/12:02
Most sites now use adaptive streaming HLS/DASH, which have different streams for audio and video or/and both can be split in chunks. You can't download these like a normal file (progressive streaming, eg:mp4), you have to download them manually and use a tool to mux them together or use a tool to download/mux them. ffmpeg is such a tool.

Open the browser dev tools (ctrl+shift+i), go to the network tab, start the twitch video, search for "m3u8". This is the HLS stream, which contains multiple streams, one for each quality.

If you can't find m3u8, search for mp4, some videos have progressive streams. You can download this as any file.

Robert J.
2021-07-05/13:42
Thanks for explaining all this to me. I have sometimes seen those m3u8, like in live streams on YT. I've always waited until the streaming was over and posted as mp4 before downloading. If I understand you right, I should download those “chunks” and try and join them with ffmpeg, correct?

But does that imply that I have to run the whole video in the browser until it's done, before downloading all of them? Which kind of defeats my purpose...

Anyway, following your instructions with the Twitch URL at the top of this thread, in the dev/network interface I only find "mp2t" file types, with URLs like these:

https : // d1m7jfoe9zdc1j.cloudfront.net/eeabddd8ad0476add87a_bordernights_42560378685_1624727268/chunked/13.ts

https: // d1m7jfoe9zdc1j.cloudfront.net/eeabddd8ad0476add87a_bordernights_42560378685_1624727268/chunked/40.ts

I'm not quite sure how I'll be able to download all of them in one shot, but are these the chunks to be joined?

sebaro
2021-07-05/21:40
Those are ts (chunks), you have to find the m3u8 file, start/restart the video after you open the dev tools. The m3u8 file will contain a m3u8 file for each video quality, these will have the list of ts files. If you can't use ffmpeg or other video tool, download each ts from an m3u8 file and concatenate them. If it's a live stream you'll have to wait until it's finished.

Robert J.
2021-07-07/18:17
OK, it wasn't easy, but after a while I did succeed in getting the two m3u8 files that belong to this video. One of them:

https: // d1m7jfoe9zdc1j.cloudfront.net/eeabddd8ad0476add87a_bordernights_42560378685_1624727268/480p30/index-dvr.m3u8

with contents:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#ID3-EQUIV-TDTG:2021-06-26T18:11:21
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TWITCH-ELAPSED-SECS:0.000
#EXT-X-TWITCH-TOTAL-SECS:3801.232
#EXTINF:10.000,
0.ts
#EXTINF:10.000,
1.ts
#EXTINF:10.000,
2.ts
#EXTINF:10.000,

[...]

380.ts
#EXT-X-ENDLIST

But there must still be something that's beyond my understanding — unless it's because ffmpeg is too old (0.0.9y-r2), from a time before the age of m3u8? I can imagine that a (the) URL is necessary to go and collect those .ts files, but this m3u8 doesn't have a URL in it, and I cannot find where to enter a URL in the application's interface — apparently it can only open an existing file.

sebaro
2021-07-07/21:47
The multi quality manifest is before the one you found:
https://usher.ttvnw.net/vod/1068412404.m3u8....
If the ts doesn't have a url you have to create it from the m3u8 url, replace "index-dvr.m3u8" with the ts file.

You can use cli:
curl URL/index-dvr.m3u8 | grep ts | while read l;do wget URL/$l;done

vlc
jhj
2021-07-05/21:53
play on vlc

Age restricted not working again
Digifan23
2021-07-08/06:08

sebaro
2021-07-08/08:54

Hugh
2021-07-17/16:12
Mozilla/5.0 (Android 10; Mobile; rv:82.0) Gecko/82.0 Firefox/82.0

I test on that video with m.youtube domain and it doesn't work.

Works with www.

Can you please possibly use the above user agent I use and make a fix? That user agent works well, has all different VT video qualities available and I use it cos it doesn't use the polymer that www. uses. I can't stand it as it hangs a lot. www. doesn't work well with desktop browsers considered old even though they are built in 2021.

Thank you.

sebaro
2021-07-18/21:48
Try now.

Hugh
2021-07-20/14:34
I presume you updated the above test script? It still doesn't work for m. domain. Thanks for trying though.

sebaro
2021-07-21/10:01
Try now.

Hugh
2021-07-21/13:49
Results are it can load but most of the time it won't and defaults to the sign in placeholder.

Using these below and changed the user agent to the one I listed above for youtube in about:config. They already have one set but I don't like it, hangs and stalls too much, overall crappy experience.

https://github.com/janekptacijarabaci/greasemonkey/releases/download/3.31.4Fork/greasemonkey-3.31.4-pm_forkBranch.xpi

https://basilisk-browser.org/download.shtml

Browser was given an update two days ago.

sebaro
2021-07-21/21:18
The message is shown after the script has loaded. Increase this value on line 1603: "}, 1000);".

Hugh
2021-07-22/14:59
It still won't work.

https://github.com/yt-dlp/yt-dlp

I spotted in youtube-dl fork, they add this recently in their changelog.

yt-dlp 2021.07.21

Added player_client=ios
Add age-gate bypass for android and ios clients

Maybe something useful in their commits that can be applied to the script?

https://github.com/yt-dlp/yt-dlp/commit/c888ffb95ab0ab4f4cd1d6c93eda014f80479551

https://github.com/yt-dlp/yt-dlp/commit/2fd226f6a76715e429709d7172183d48e07c7ab3

sebaro
2021-07-22/21:12
What did you try?

Hugh
2021-07-23/15:19
I increased it up to 8000, saved, and it wasn't doing anything different to my eye. I didn't want to go too high since I don't know what the value means.

Also the right side of the video player in the test script is now slightly overlapping with the content on the right. It isn't with the stable version.

sebaro
2021-07-23/21:54
The link above stopped working for me on both desktop and mobile and both youtube-dl, yt-dlp.

Hugh
2021-07-24/12:23

Subject1
Author1
2021-07-22/15:28
Message1

Author1
2021-07-24/05:56
Message1

Subject113
Author13
2021-07-24/05:56
Message13

viki
yu
2021-07-28/09:50
at viki look like can't get the file link

sebaro
2021-07-28/10:21
VIKI uses DRM/encryption.