Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.08k stars 87 forks source link

retry delay #64

Closed Lytexx closed 2 years ago

Lytexx commented 2 years ago

I'm getting 401 error again and only on guras streams for some reason this makes it basically impossible for me to download her livestreams, maybe a retry delay after errors would help

here is a short clip of what's happening, I'm not using the --threads flag

https://user-images.githubusercontent.com/28214667/141662143-1acc4b78-bb07-4c57-99fe-993f4c9a0aed.mp4

Kethsar commented 2 years ago

Did you load cookies in this example? Is this on a remote server or on a PC where you have a logged in Youtube session? Is a VPN currently in use? The 401 issue is very inconsistent. I can usually set 8 threads and be fine, but 9 or more and it dies. Someone else I know managed 15+, and another actually used around 50 at least once and was fine.

A direct retry delay on 401 won't help since it needs to have the download link refreshed like with 403, I think. I just haven't added that immediate refresh attempt like the 403 yet. I could attempt to gradually decrease threads and how often I allow a new download job to take place each time a 401 is encountered, but at some point it could well end up being so slow that the download will never catch up, or even keep up if started early.

Kethsar commented 2 years ago

Also I just realized but yes, --threads is being used in this video. You can tell by how the debug messages show video1, 2, 3, 4 and audio1, 2, 3, 4. Unless this recording was from someone else.

Lytexx commented 2 years ago

Did you load cookies in this example?

no

Is this on a remote server or on a PC where you have a logged in Youtube session?

remote server. and I'm not logged in there

Is a VPN currently in use?

no

Also I just realized but yes, --threads is being used in this video. You can tell by how the debug messages show video1, 2, 3, 4 and audio1, 2, 3, 4. Unless this recording was from someone else.

I'm pretty sure I didn't use it, I will try again on gura's next stream

Kethsar commented 2 years ago

Loading cookies is a good way to mitigate the 401s. Someone on IRC complained about them a couple months ago, I told him to use cookies, and he said that helped. This is especially true for a remote server. Youtube seems more lenient when you are using an IP that has an active login, and in the cases that you do not, cookies will help even more.

Since you don't seem to think you are using --threads, are you running the command from a script and maybe forgot it was set?

Lytexx commented 2 years ago

Since you don't seem to think you are using --threads, are you running the command from a script and maybe forgot it was set?

yeah that was probably it, using cookies helped.