maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [WIP] LLs Video Player (https://talk.maemo.org/showthread.php?t=92141)

llelectronics 2015-07-31 19:43

Re: [WIP] LLs Video Player
 
You can already choose the video quality for youtube videos and download them.

HtheB 2015-07-31 23:31

Re: [WIP] LLs Video Player
 
Quote:

Originally Posted by llelectronics (Post 1478387)
I don't know dreambox streams.
Did you try copying the stream url and try loading it in LLs Video Player?

thats the problem, i dont get to see the link with the sailfish browser :(
I will pm you the details on how to get my stream so you can check it out :)

nodevel 2015-08-01 06:02

Re: [WIP] LLs Video Player
 
Quote:

Originally Posted by llelectronics (Post 1478395)
You can already choose the video quality for youtube videos and download them.

Ah, my bad, I must have been using some older version!

But I still cannot choose the quality of (for example) this video, even though the youtube-dl script shows different formats/qualities. Or maybe I juat can't find the option in the UI :rolleyes:

llelectronics 2015-08-01 08:57

Re: [WIP] LLs Video Player
 
Quality changes only works for youtube so far as this is the only plattform I can check what the codecs are and if it they are supported.

Schturman 2015-08-01 10:41

Re: [WIP] LLs Video Player
 
Hi
I have a little problem when I want to save video from link.
For example I opened video link in browser -> copied it -> inserted to "Enter URL" -> press "Load URL" and now when it finish to load I can swipe down and choose "Download". It will download file but without suffix :( Now if I will swipe down again I can choose "Download with Curl" and now it will save file with suffix.
Why it can't download in first time with suffix ?
Thanks

llelectronics 2015-08-06 09:35

Re: [WIP] LLs Video Player
 
Quote:

Why it can't download in first time with suffix ?
Interesting question.
I will investigate this. Maybe there is no suffix given in the file location (youtube for example does not give any) and the QtNetworkAccessManager does not to seem autodetect and add a suffix which curl does apparently.

edit: Apparently QNetworkAccessManager gets the Mimetype "application/octet-stream" so it does not add an extension to the filename. I am not sure I can fix that so fast.

Schturman 2015-08-06 12:54

Re: [WIP] LLs Video Player
 
Quote:

Originally Posted by llelectronics (Post 1478789)
Interesting question.
I will investigate this. Maybe there is no suffix given in the file location (youtube for example does not give any) and the QtNetworkAccessManager does not to seem autodetect and add a suffix which curl does apparently.

edit: Apparently QNetworkAccessManager gets the Mimetype "application/octet-stream" so it does not add an extension to the filename. I am not sure I can fix that so fast.

Thanks for answer, not a problem. Maybe you can add "Download with curl" near to the first "Download"? In this case we can download directly with curl and suffix.

llelectronics 2015-08-06 12:59

Re: [WIP] LLs Video Player
 
Hmm... ok another update.
Curl isn't more intelligent then QNetworkAccess.
I found that I just added .mp4 to every file it downloads :P

So this is no real solution either.
[s]I digged in a little bit more and found out that Youtube tries to hide their mimetype so that even running a mimetype check on the file after downloaded turns out to be a application/octet-stream.

So for now I don't see a solution. The only thing I could do is hardcode the suffix somehow for the expected youtube file.[/s]

edit: This is all crap I wrote above (except for curl which I really hardcoded to use .mp4 for every filename)

I found a solution. By default QMimeDatabase is prioritising filename over filecontent when it comes to detecting the mimetype. As the youtube videos are detected as application/octet-stream on downloading. But after the file is downloaded and the file content is clearly a video file I can force QMimeDatebase to only scan the file content to get the correct mimetype as a normal scan with the filename .bin would throw out application/octet-stream again.
And guess what this seems to work.

So basically this means:
If you download a youtube video it will get the ending .bin for the initial filename. If the download is finished this should be renamed to webm mp4 or flv or whatever the file really is.

Basically this is true for every file you want to download that does not provide a file ending.
Ulrs which have a file ending will initially have the correct file ending also during download.

I know that is a lot of explaination. But I think its fine for some of you to see how complicated easy things can get sometimes.

Schturman 2015-08-06 14:47

Re: [WIP] LLs Video Player
 
Cool! Thanks ;)

llelectronics 2015-08-06 15:57

Re: [WIP] LLs Video Player
 
Update: 0.9-6 includes now this Download Manager fix.
Enjoy.

RPM


All times are GMT. The time now is 15:32.

vBulletin® Version 3.8.8