Bouni / ard-mediathek

commandline download of ARD videos
MIT License
16 stars 3 forks source link

Fix quality #16

Closed sol23 closed 5 years ago

sol23 commented 5 years ago

quality 3 as a default did no longer work. Also the highest 940p quality was not found due to taking the first element.

steffenschroeder commented 5 years ago

Hi, with what URL have you tested? I also played around with this project this week and found it constantly working. The qualities are grouped like the ARD was returning is - this I also saw what they sometimes returned Quality 3 for 960p and sometimes a different resolution of the same quality. Also with the auto quality there is sometime a "hidden" resolution (1280p)

Would be really interresting what your test cases have been.

Thanks, Steffen

steffenschroeder commented 5 years ago

Tested with https://www.ardmediathek.de/tv/Tatort/Hinter-dem-Spiegel/NDR-Fernsehen/Video?bcastId=50341652

Without quality (implies quality 3) flag - it downloads a 2.3GB file works With quality 2, it downloads a 778MB file

Do I miss something here?

We need the test case which was the base of this PR.

sol23 commented 5 years ago

For me it was http://www.ardmediathek.de/play/media/56949560.

steffenschroeder commented 5 years ago

Ok, your fix works for this specific video because,

IMHO if quality 3 is not available, the scirpt should automaticall fall back the the next best/worst and decide what's the best there.

Just always do amd.quality = args.quality - 1 will probably be more harmful in the general case, because:

  1. you are not able to download Quality 3 (even is it exists)
  2. when choosing quality 1, you might run into a key error because quality 0 might not exist.

But all in all, the is a hard case. @Bouni any idea about the quality? How to get the best quality out of the streams?

Best, Steffen

sol23 commented 5 years ago

Hi I only fixed it for my use case :) Now I looked into it and I found that only in quality 2 the stream order is different. I actually cannot say why but I checked now 20 random shows and it seams to be a pattern :)

So I guess it would actually work to use [-1] in quality 2 and [0] everywhere else.

Also with the quality I agree, if quality 3 is not available it should fallback to the highest one and not fail.

steffenschroeder commented 5 years ago

Maybe we could get around guessing the quality completely by:

  1. collecting all URL
  2. get the file size of the videos behind the URL
  3. prompt the User the select the one that he desires (showing the file size)
  4. Download that video

This would be an incompatible change and might break the usage in cron jobs etc. There would be also a --best flag which automatically picks the biggest video.

Any thoughts in this?

Bouni commented 5 years ago

@Bouni any idea about the quality? How to get the best quality out of the streams?

@steffenschroeder Actually, no idea. I've not looked into it for a long time and to be honest, I'm amazed by you guys pushing this little project so hard. Thank you so much :+1:

In my opinion, downloading the best quality should be default, the user should set any lower quality if he wants it. But I'm not sure how to get the available quality versions.

steffenschroeder commented 5 years ago

with #17 I implemented https://github.com/Bouni/ard-mediathek/pull/16#issuecomment-431573432 @sol23 if you like, please test. If everything is alright, we can close this PR