Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.01k stars 83 forks source link

"401 Unauthorized" spam from already-long-running stream (~1hr) on Linux, not Windows #180

Closed helpimnotdrowning closed 4 months ago

helpimnotdrowning commented 4 months ago

Ive noticed for a while now that on Linux, streams that have already been live for a while will sometimes lock up within the first 100 fragments of their download and spam something like

2024/03/XX XX:50:09 DEBUG: video7: HTTP Error for fragment 48: 401 Unauthorized
2024/03/XX XX:50:10 DEBUG: video10: HTTP Error for fragment 50: 401 Unauthorized

constantly. The download will progress, but extremely slowly (in the order of tens of fragments/minute). This happens on 0.3.2, 0.4.0, and the latest commit via go install

This does not occur on my Windows machine, which will happily accept whatever I throw at it. It's running 0.3.2 still.

Both of these machines are on the same network, using the exact same cookies file.

I am currently trying to download this stream https://www.youtube.com/watch?v=qxhAtaF5hDQ , but it will be unarchived after it finishes.

Using:

helpimnotdrowning commented 4 months ago

Quick note: I've played around with the args for ytarchive, and I've found that a threads value > ~4 creates this problem. Windows handles 10 threads with no issue.

Kethsar commented 4 months ago

That's just Youtube being Youtube, there is nothing I can do about it. In my testing, I was able to be safe at --threads 7 but beyond that, I got issues. Someone else I know says he's gone as high as --threads 32 and been fine. It's the fickleness of Youtube itself, I don't know how it determines who to let spam more requests and who it throttles with far fewer made.