tartube icon indicating copy to clipboard operation
tartube copied to clipboard

Don't download thumbnail

Open ILove07Gold opened this issue 3 years ago • 19 comments

Is there an option to not download the thumbnail? i dont need it. Using the classic mode, and every time i have to delete the thumbnail file that is downloaded.

ILove07Gold avatar Feb 02 '22 03:02 ILove07Gold

If you are using the Videos tab, click Edit > General download options.

If you are using the Classic mode tab, click the menu button in the top-right corner, and select Edit download options

In the new window, click the Files > Write files tab, and deselect Write the video's thumbnail to the same folder

Alternatively, in the Keep files tab, deselect Keep the thumbnail file after the download has finished

axcore avatar Feb 02 '22 07:02 axcore

Might be a bug because "Keep the thumbnail file after the download has finished" absolutely does nothing to me. Thumbnail is kept even if it's not checked. Not writing it in the first place is an option image

PatrickL546 avatar Mar 13 '22 13:03 PatrickL546

@PatrickL546, make sure that the download options you're modifying apply to the videos you are downloading.

Click Edit > System preferences... > Options > Download options

In the list there should be at least two items, general and classic,like this:

options

If your window doesn't look exactly like that, take a screenshot and show me.

If your window does look exactly like that, then general applies to the Videos tab, and classic applies to the Classic Mode tab. Make sure you have modified the correct set of options.

axcore avatar Mar 13 '22 14:03 axcore

My system settings is exactly like that. I edited the generals download options and untick the settings and downloaded a video. It's still there. image

I even tried image with image And only thumbnail is kept.

Version is latest stable and yt-dlp is updated as well.

PatrickL546 avatar Mar 14 '22 09:03 PatrickL546

What happens when you select everything in the Keep files tab?

By way of an explanation: yt-dlp lets you choose which files to download. Tartube wants to read some of those files, so you can let Tartube download them and then discard them (or keep them, if you want to keep them).

axcore avatar Mar 14 '22 11:03 axcore

It works as intended image again, I unchecked all keep files image Only thumbnail is kept.

PatrickL546 avatar Mar 14 '22 16:03 PatrickL546

You're looking at an original thumbnail in .webp format. Gtk can't display .webp images (hardly anything can), so FFmpeg converts it into something that is visible (.png).

For some reason the original isn't deleted straight after conversion. I will look into that, just as soon as you give me the link to the video you're trying to download there.

axcore avatar Mar 14 '22 17:03 axcore

Here's the vid: https://www.youtube.com/watch?v=aSgnmiVSsAI Just a random video that was in my home page. I checked already that this is happening on other youtube videos

PatrickL546 avatar Mar 14 '22 18:03 PatrickL546

Sorry for the delay in responding.

I can't reproduce your problem, despite several attempts. If you are still here, you can try download the video again, then when it fails to delete the image file, take a screenshot of the yellow text at the top of the Output tab so I can make sure I am replicating your exact setup.

axcore avatar Jun 08 '22 08:06 axcore

I've updated to the newest version released 8 days ago, updated yt-dlp. ~~It's not downloading the thumbnail anymore. Seems to be fixed somehow.~~

nvm. It still happens. File write options top section is all checked. but Keep options is empty. Only the thumbnail is kept but all other files are removed.

removed folder paths from img. image

PatrickL546 avatar Jun 08 '22 09:06 PatrickL546

Ok, I have tested an identical setup on both Linux and MS Windows, but I still can't reproduce your problem.

samesetup

axcore avatar Jun 08 '22 11:06 axcore

If you feel like burrowing around in the code, you could add some debug messages in the ../tartube/utils.py in the handle_files_after_download() function.

Github's text editor is broken, so I am forced to use screenshots rather than copy-pasting the code.

v1

v2

` # Thumbnail file if dummy_obj: thumb_path = find_thumbnail(app_obj, dummy_obj) else: thumb_path = find_thumbnail_from_filename(app_obj, dir_path, filename)

print("thumb_path")
print(thumb_path)

if thumb_path and not options_obj.options_dict['keep_thumbnail']:

    new_path = convert_path_to_temp(app_obj, thumb_path)
    print("new_path")
    print(new_path)

    if os.path.isfile(thumb_path):
        if not os.path.isfile(new_path):
            print("move_file_or_directory")
            app_obj.move_file_or_directory(thumb_path, new_path)
        else:
            print("remove_file")
            app_obj.remove_file(thumb_path)

elif thumb_path \
and not os.path.isfile(thumb_path) \
and options_obj.options_dict['move_thumbnail'] \
and dummy_obj:

    print("move_thumbnail_to_subdir")
    move_thumbnail_to_subdir(app_obj, dummy_obj)`

axcore avatar Jun 08 '22 11:06 axcore

So in your case, the folder doesn't end up like this after running the code? image

I'll look at the code when I have time.

PatrickL546 avatar Jun 08 '22 18:06 PatrickL546

Yes, I tested it about 20 times today. The .webp appears during the download, but is always removed at the end, leaving just the video file.

axcore avatar Jun 08 '22 18:06 axcore

You have double- and triple-checked that you are using the download options for the Classic Mode tab, right?

(In that tab, click the menu icon in the top-right, and select Edit download options. Alternatively, from the main menu, click Edit > System preferences ... > Options, and see which set of download options is marked for use with Classic Mode.)

axcore avatar Jun 08 '22 18:06 axcore

Mystery kinda solved? Went into tartube install location and deleted settings.json. I do the same thing i've been doing and the thumbnail is removed somehow. Checked

(In that tab, click the menu icon in the top-right, and select Edit download options. Alternatively, from the main menu, click Edit > System preferences ... > Options, and see which set of download options is marked for use with Classic Mode.)

that options and it's the same with new and old settings.json.

Somehow my old settings.json is causing it. I used the same tartube.db. Maybe because i've kept the same settings.json through the new versions of tartube? I'll upload my old settings and maybe see what's causing it. Settings Default settings I used

PatrickL546 avatar Jun 09 '22 04:06 PatrickL546

I tested both settings.json files with the same video. The result is the same: the images are deleted, leaving only the videos.

During download test1

After download test2

axcore avatar Jun 11 '22 06:06 axcore

I'll just record what happens

PatrickL546 avatar Jun 11 '22 07:06 PatrickL546

I used the exact same settings here except I added the download paths. As you can see at the end, the normal download with default settings.json deleted the thumbnail but the classic download doesn't delete it. Used a different video so it's smaller download.

old settings.json - Doesn't delete when using normal download and classic. default settings.json - Deletes when using normal download but not when using classic.

Here's the high quality one

https://user-images.githubusercontent.com/75874561/173200250-8061789c-8a5a-4a49-9fe1-dfe474656170.mp4

PatrickL546 avatar Jun 11 '22 10:06 PatrickL546

The code handling deletion of unwanted thumbnails has been rewritten for the v2.4.165 release. I was never able to reproduce your problem, but whatever the cause was, that code doesn't exist any more.

Since you could repair your setup by replacing the settings file, I'll go ahead and close this issue, but feel free to open a new one if the same problem occurs again.

axcore avatar Nov 25 '22 06:11 axcore