Giter VIP home page Giter VIP logo

Comments (7)

ImportTaste avatar ImportTaste commented on June 12, 2024

I believe it's because both those projects download in 10MB chunks

Here's Invidious: https://github.com/iv-org/invidious/blob/9dfa268204f20b6eba65d3f0977a590e3fbfc120/src/invidious/routes/video_playback.cr#L120 (HTTP_CHUNK_SIZE is 10485760 which is ~10MB)

And here's yt-dlp: https://github.com/yt-dlp/yt-dlp/blob/4d9280c9c853733534dda60486fa949bcca36c9e/yt_dlp/extractor/youtube.py#L3671

Unfortunately I don't really know how to implement this into youtube-local, but I think this is the core of the issue.

Also, you should also pass 'params': '8AEB', in the root of the JSON request, as this lets the Android client play YouTube Stories.

from youtube-local.

user234683 avatar user234683 commented on June 12, 2024

@ImportTaste Current chunk size is 262144 bytes, set in line 116 in server.py if you want to try it. Can't check if it works until tomorrow night

Edit: Those are the TCP chunks, so that would be the wrong value to change. Looking more closely, now I see what you're pointing at is that they split up the single range request into multiple range requests in 10 MB chunks, so we would need to split it up into a for loop like they do.

from youtube-local.

ImportTaste avatar ImportTaste commented on June 12, 2024

@ImportTaste Current chunk size is 262144 bytes, set in line 116 in server.py if you want to try it. Can't check if it works until tomorrow night

Edit: Those are the TCP chunks, so that would be the wrong value to change. Looking more closely, now I see what you're pointing at is that they split up the single range request into multiple range requests in 10 MB chunks, so we would need to split it up into a for loop like they do.

That seems to be the case. it's beyond my ability to implement, but I hope I was of some help regardless.

from youtube-local.

user234683 avatar user234683 commented on June 12, 2024

It appears that's not the issue. As it is, video file requests using av-merge.js already split the requests into small range requests. Additionally, I ran an experiment where I inserted urls from yt-dlp into youtube-local, and the video played fine without 403s, so something is wrong with the URLs themselves. Looking into it

from youtube-local.

user234683 avatar user234683 commented on June 12, 2024

The params was the problem, thanks for pointing that out. Latest release fixes it

from youtube-local.

ImportTaste avatar ImportTaste commented on June 12, 2024

There's an age-restricted video that is exhibiting the same throttling behavior that I experienced with this issue. Is it related to #146?

from youtube-local.

user234683 avatar user234683 commented on June 12, 2024

There's an age-restricted video that is exhibiting the same throttling behavior that I experienced with this issue. Is it related to #146?

Yes, because for those it uses the TVHTML5_SIMPLY_EMBEDDED_PLAYER client instead of the ANDROID client. Android doesn't require decryption. TV embedded does, and one encryption thing is that nsig which causes the video to be throttled

from youtube-local.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.