-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying per-item request headers (for playback and downloads) #6166
Comments
I don't think we currently support this (you can of course implement your own download functionality, rather than relying on the out-of-the-box components that we provide). Marking this as an enhancement. |
@marcbaechinger - We should consider whether we want to allow request headers to be specified in |
Same problem here. Even if I don't allow the user to download two videos al the same time, the DownloadService only request DownloadManager once, so the second video will use the DownloadManger of the first one and fail because of wrong cookie. |
+1 for specifying headers in a |
+1 I would also like this feature |
Hi @ojw28, I'm about to start looking into contributing a fix for this, but wanted to check in first with a couple of questions.
|
No
Although not directly what you're trying to achieve, I think a good first step would be to add Then for downloads I think you'll need to:
Note that I haven't actually tried any of the above, so I can't really guarantee it's correct or accurate. It's a best guess as to what would be needed.
Small changes are preferred to larger ones (i.e., the playback and download pieces suggested above should definitely be separate pull requests, rather than one big one). Other stuff that's probably obvious:
|
Thanks for the info. For future questions, is there a better way to ask, or is leaving them here the best place? |
Here is fine; thanks! |
@ojw28 Perhaps there's another way to do this. I had initially tried to solve this problem in my client by using I'm having trouble tracking how the I was able to hack a solution into place on the client side by extending |
Is there any update on this? I'm running into the problem that I can't download files that require an authentication header. |
it's working. just add DefaultHttpDataSource.Factory to DownloadManager. like this code:
|
@Mkurbanov That solution is fine if you only need a single header that's the same for all downloads. If you need a different header per-download, this won't work. |
I've generalized the title to cover the playback case as well as the download case. Note that there is a pending pull request that looks to add this (#7852), although I was concerned at the time that:
|
I have different cookies for each video.
so each time new video is loaded, I set DownloadManager with new cookie.
defaultHttpDataSourceFactory.getDefaultRequestProperties().set("Cookie", cookieValue);
however, I can only download video for the first time.
I think DownloadService seems to call DownloadManager only when DownloadService is started for the first time.
How do I download video with each different cookie?
The text was updated successfully, but these errors were encountered: