Comments (22)
In the latest debug version, The download speed was improved, but only works for <10min songs, it's still slow to download the songs which are longer than 10min
screen-20230624-124151.mp4
from innertune.
The slow download speed is caused by YouTube's throttling.
If you want to download YouTube streams at full speed, you have to make it look like you are streaming. Download the file in chunks with a maximum size of 10MB and specify the chunk size either using the Range
header or the &range=0-10000000
url parameter.
If you use the Range
header, YouTube will send you a Content-Range
header back, from which you can extract the total file size and figure out, how many more chunks need to be downloaded.
If you are using the URL parameter method (which is used by the YouTube web player), you need to know the total file size beforehand. It can be extracted from YouTube's player response and it is included in the stream URL as well (clen
parameter).
You can use concurrent connections to download multiple chunks at a time, but that is optional. Most music tracks are smaller than 10MB anyway, so they can be downloaded in just 1 chunk.
Adding a bit of randomness to the chunk size is good style, yt-dlp does it too, but I dont know if it is really necessary.
from innertune.
The song is saved in the app-specific external files directory. You'll see them in (/Android/data/com.zionhuang.music/files/media), and the filename is the hash of the song id. How users can receive the files are in the roadmap. Possibly providing a share option in the three-dots song menu and implementing a DocumentProvider. Some ideas are mentioned in #3.
The app uses Android DownloadManager to download files. I also experienced a slow download speed. It shouldn't be that slow, but there seems to be no method to tweak that. I'll implement a custom downloader instead. It should be faster.
from innertune.
I might make a PR for this soon
Oh yeah, thank you for this app, it is exactly what I wanted, I had been planning to make an app like this but I then discovered your app.
Much thanks!
from innertune.
Have you try the debug APK in feature/innertube
branch? Things has changed a lot.
from innertune.
I haven't taken a look at the code/branches yet, so no
From your reply I guess the downloads are faster now? Great
from innertune.
From your reply I guess the downloads are faster now?
No, I haven't fixed.
from innertune.
From your reply I guess the downloads are faster now?
No, I haven't fixed.
How about this library https://github.com/lingochamp/FileDownloader
from innertune.
Or https://github.com/LagradOst/Aria2cButton
A friend made it so I couldn't hold back and not share it.
It uses aria2 to do the downloads.
And you may already know, but aria2 is super fast.
from innertune.
I haven't spent time on this, so I can't say too much. Maybe eventually I need to write my own library for it, which will take massive time. However, I don't prefer aria2 because it is a command line tool and needs a wrapper to make it a java library.
from innertune.
I haven't spent time on this, so I can't say too much. Maybe eventually I need to write my own library for it, which will take massive time. However, I don't prefer aria2 because it is a command line tool and needs a wrapper to make it a java library.
Yes, I sent a library that wraps the json rpc aria has.
from innertune.
I mean the interface may not be rich. Say, it doesn't support proxy.
from innertune.
aria2's json rpc has everything accessible via the CLI and much more
Extending the wrapper to support proxies won't be that hard.
from innertune.
I don't think so. In short, it lacks flexibility.
from innertune.
What?
How does it lack flexibility?
And if you can't be arsed to read the code in order to add proxy support, here are the two places you need to modify so you can use proxies with aria2: AbstractClient.kt#L366-L395 and
Aria2Classes.kt#L36-L106
from innertune.
Then I'll use other libraries or write one for my own instead. Communicating with a layer of json rpc just looks ugly for me. Also, the file size of a song is roughly 3~5MB. We don't really need a super fast downloader.
from innertune.
Then I'll use other libraries or write one for my own instead. Communicating with a layer of json rpc just looks ugly for me. Also, the file size of a song is roughly 3~5MB. We don't really need a super fast downloader.
The current downloader is capped at 80kb/s, I don't know why, might be because it is using a single connection for each download
The fact is that you will die if you want to download your entire library...and a fast downloader is a must
from innertune.
@Theta-Dev Is there a way to somehow speed up the download speed or bypass the throttling somehow? 🤔
from innertune.
Also you can add to the auto download feature, that it only downloads when wifi is available
from innertune.
@Theta-Dev Is there a way to somehow speed up the download speed or bypass the throttling somehow? 🤔
Found a way to do speed up
- Download any song
- Pause the download in notification
- Resume it
- Download is faster than before (2 MB/s for me)
This is working for me, I'm not sure is it work for th others, but you can try to reproduce it
from innertune.
@Theta-Dev Is there a way to somehow speed up the download speed or bypass the throttling somehow? 🤔
Found a way to do speed up
- Download any song
- Pause the download in notification
- Resume it
- Download is faster than before (2 MB/s for me)
This is working for me, I'm not sure is it work for th others, but you can try to reproduce it
ScreenRecord-20230217-204210.mp4
from innertune.
@Theta-Dev Is there a way to somehow speed up the download speed or bypass the throttling somehow? 🤔
Found a way to do speed up
- Download any song
- Pause the download in notification
- Resume it
- Download is faster than before (2 MB/s for me)
This is working for me, I'm not sure is it work for th others, but you can try to reproduce itScreenRecord-20230217-204210.mp4
I don't have the option to pause the downloads
from innertune.
Related Issues (20)
- Crash when typing % in the search bar
- Crash when trying to share artist profile page HOT 1
- [FEATURES REQUEST] Bring Spotify Client.
- Pls Add some Extra new feature pls HOT 1
- dark fork HOT 1
- 大佬,可以提供youtube v1接口的api文档吗,感谢🙏 HOT 1
- sync history with yt music
- Request to add ability to auto genrate playlists based on previous history.
- Video HOT 2
- Request for Designing Wear OS Watch Interface HOT 2
- Auto sync playlist, library, likes, etc. when launch app.
- Shuffle songs after playing a song you choose HOT 2
- There are no songs in the profile, singles remain loading etc. HOT 2
- App opens all YouTube links from discord by default, can't seemingly stop it. HOT 6
- Discord RPC Support
- Android auto ? Is it enabled? I dont see it. HOT 1
- Random crash whilst playing songs in the background HOT 2
- ability to block explicit songs HOT 3
- New release albums based on country, not feed
- Crash when trying to download
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from innertune.