deniscerri / ytdlnis

Android Video/Audio Downloader app using yt-dlp
GNU General Public License v3.0
3.31k stars 117 forks source link

[BUG] Videos don't download as per preference when download card is not loaded. #451

Closed Dev123456689 closed 3 months ago

Dev123456689 commented 3 months ago

** Before making an issue make sure you are using the latest version of yt-dlp in the settings. Perhaps try using the nightly version of yt-dlp. If that didn't help, proceed with the issue

Describe the bug When download is started before the download card is loaded or Quick download is enabled, then the app doesn't respect the preference and downloads a very low quality video.

To Reproduce Steps to reproduce the behavior:

  1. Set up your preference in the settings (example: preferred video quality:720p, audio quality, format etc)
  2. Search for a YouTube video and start downloading it before the download card is fully loaded, or enable quick download and then download a YouTube video.
  3. The video will not be downloaded as per your specified preferences.

Expected behavior The app should download as per the selected preference whether the download card is loaded or not.

Screenshots / Video Recording If applicable, add them to help explain your problem.

(please complete the following information):

Additional context Add any other context about the problem here.

teddysulaimanGL commented 3 months ago

Send the URL, and tell me if there is any difference with the fully loaded card and if that URL even has that resolution

Dev123456689 commented 3 months ago

No, the problem doesn't occur when the download card is fully loaded. I have tried to recreate the problem with many YouTube video downloads before reporting the issue and the problem is consistent with each of the video I tested.

For your testing purpose these are few of the URLs the problem has occurred with: URL 1 URL 2 URL 3

teddysulaimanGL commented 3 months ago

Can't reproduce. Send either Log (enable it first if you haven't) or Current Command using Add Extra Commands chip

Dev123456689 commented 3 months ago

I don't know where the log files are stored but I got this from the logs shown inside the app itself Log:

Downloading: Title: The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 URL: https://youtu.be/2GKykLyEL2M Type: video Command: -N "16" --trim-filenames "183" --no-mtime --parse-metadata "uploader:(?P.+)(?: - Topic)$" --parse-metadata "%(uploader,channel,creator,artist|null)s:%(uploader)s" --merge-output-format "mkv" --embed-thumbnail -S "+hasaud,+size,vcodec:av01,acodec:opus,ext:mkv" -f "bv[height<=720]+ba/bv[height<=720]/b" --embed-subs --sub-langs "en.,.-orig" -P "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14" -o "%(title)s - %(uploader)s - %(id)s.%(ext)s" --sponsorblock-mark "poi_highlight" --convert-thumbnails "jpg" --embed-chapters --replace-in-metadata "video:title" ".+" "The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨" --replace-in-metadata "video:uploader" ".+" "Nishant Chahar" "https://youtu.be/2GKykLyEL2M"

[youtube] Extracting URL: https://youtu.be/2GKykLyEL2M [youtube] 2GKykLyEL2M: Downloading webpage [youtube] 2GKykLyEL2M: Downloading ios player API JSON [youtube] 2GKykLyEL2M: Downloading android player API JSON [youtube] 2GKykLyEL2M: Downloading player 1ced3a71 [youtube] 2GKykLyEL2M: Downloading m3u8 information [MetadataParser] Could not interpret 'uploader' as '(?P.+)(?: - Topic)$' [MetadataParser] Parsed uploader from '%(uploader,channel,creator,artist|null)s': 'Nishant Chahar' [SponsorBlock] Fetching SponsorBlock segments [SponsorBlock] No matching segments were found in the SponsorBlock database [info] 2GKykLyEL2M: Downloading 1 format(s): 160+139 [MetadataParser] Changed title to: The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 [MetadataParser] Changed uploader to: Nishant Chahar [info] There are no subtitles for the requested languages [info] Downloading video thumbnail 41 ... [info] Writing video thumbnail 41 to: /storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.webp [ThumbnailsConvertor] Converting thumbnail "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.webp" to jpg Deleting original file /storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.webp (pass -k to keep)

[Merger] Merging formats into "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.mkv" Deleting original file /storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.f139.m4a (pass -k to keep) Deleting original file /storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.f160.mp4 (pass -k to keep) [EmbedSubtitle] There aren't any subtitles to embed [Metadata] Adding metadata to "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.mkv" [EmbedThumbnail] ffmpeg: Adding thumbnail to "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.mkv" [download] 100% of 16.79MiB in 00:00:11 at 1.49MiB/s
[Merger] Merging formats into "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.mkv" Deleting original file /storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.f139.m4a (pass -k to keep) Deleting original file /storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.f160.mp4 (pass -k to keep) [EmbedSubtitle] There aren't any subtitles to embed [Metadata] Adding metadata to "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.mkv" [EmbedThumbnail] ffmpeg: Adding thumbnail to "/storage/emulated/0/Android/data/com.deniscerri.ytdl/files/downloads/14/The Reality of DSA and Development in 2024! | Hiring Market trends in 2024 for Software Engineers 😨 - Nishant Chahar - 2GKykLyEL2M.mkv"

Dev123456689 commented 3 months ago

Screenshot_2024-04-08-11-24-28-01_2bde0e07fd61d625cf63c538621e2efc

Screenshot of my preference in the processing page

teddysulaimanGL commented 3 months ago

Well, aren't you aware that you enabled "Prefer Smaller Sized Formats?" That's why. So this isn't an issue in the first place

zaednasr commented 3 months ago

SmartSelect_20240408_080031_Chrome

Check this part of rhe command. Its exactly like your preferences

Dev123456689 commented 3 months ago

I

Well, aren't you aware that you enabled "Prefer Smaller Sized Formats?" That's why.

Yes, i knew that I enabled it because I want smaller video file size but not smaller resolution.

teddysulaimanGL commented 3 months ago

Well, it doesn't seem like what it does currently. Maybe it needs to be investigated further. We'll see about that

Dev123456689 commented 3 months ago

I think the problem is when I start downloading without letting the loading to complete, all the formats are not loaded and the smaller formats are loaded first. So it leads to an issue where formats like (144p, 240p and 360p were loaded but 480p, 720p and 1080p were not loaded) amd starts downloading 360p because 720p was not found. But when I let the loading to complete then it can see that there is a 720p version and it downloads it.

Dev123456689 commented 3 months ago

Well, aren't you aware that you enabled "Prefer Smaller Sized Formats?"

I turned off this option and now it's seems to work fine. I will suggest that a clear description of all the options should be mentioned below the options so no one else mistakes what the option is for.

Thanks for helping me to resolve the issue caused by me on my side, your assistance was very helpful. Most of the time people just point out the thing that they think is the issue and closes the GitHub issue without letting the other to approve the solution but it was not the thing while discussing the issue with you. Thanks for your patience.

By the way, I till now don't understand what this option does and how it cause the problem.

teddysulaimanGL commented 3 months ago

Nah, fam. Zaed and I will figure this out

Dev123456689 commented 3 months ago

I would like to request another thing to be added to the app to improve it. When I pause and resume a download all the information needed before starting the download (webpage information, sponsor Block, etc) are re-fetched which takes time, it will be very useful if these things can be cached or saved and automatically be deleted after the download completes.

teddysulaimanGL commented 3 months ago

That's not up to the app. Those requests are handled by yt-dlp

Dev123456689 commented 3 months ago

Oh, I understand. By the way, it only takes a few sec.

zaednasr commented 3 months ago

check 1.7.5