Skip to content
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

Videos are downloaded in the worst available quality #48

Closed
4 tasks done
votemp opened this issue Aug 22, 2023 · 4 comments
Closed
4 tasks done

Videos are downloaded in the worst available quality #48

votemp opened this issue Aug 22, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@votemp
Copy link

votemp commented Aug 22, 2023

Checklist

  • I am able to reproduce the bug with the latest version.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug, that only occurs in Squawker

Affected version

v3.4.1+300003190

Steps to reproduce the bug

Download a video

Expected behavior

The best available quality of the video is downloaded (for example 720x1280)

Actual behavior

The worst available quality of the video is downloaded (for example 320x568)

Screenshots/Screen recordings

No response

Logs

No response

Affected Android/Custom ROM version

No response

Affected device model

No response

Additional information

Patch below fixes it for me:

diff --git a/lib/tweet/_video.dart b/lib/tweet/_video.dart
index 66dfc9a..27879c0 100644
--- a/lib/tweet/_video.dart
+++ b/lib/tweet/_video.dart
@@ -40,7 +40,7 @@ class TweetVideoMetadata {
         .where((e) => e.bitrate != null)
         .where((e) => e.url != null)
         .where((e) => e.contentType == 'video/mp4')
-        .sorted((a, b) => a.bitrate!.compareTo(b.bitrate!))
+        .sorted((a, b) => b.bitrate!.compareTo(a.bitrate!))
         .map((e) => e.url)
         .firstWhereOrNull((e) => e != null);
@votemp votemp added the bug Something isn't working label Aug 22, 2023
@j-fbriere
Copy link
Owner

j-fbriere commented Aug 22, 2023

I don't know if its a bug.
Maybe it was designed this way first to lower the bandwidth usage in case of downloads.
I would rather create an optional setting for this.
Thanks for the patch, it will be a research time saver for me!

@j-fbriere
Copy link
Owner

The version 3.4.2 implements the option to download videos with the best quality available.
To modify the option, go to: Settings / Download videos with best quality (the option is deactivated by default).

@votemp
Copy link
Author

votemp commented Aug 24, 2023

Thanks! Tested, works.

@j-fbriere
Copy link
Owner

Glad it works. Closing the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants