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

Allow for downloading metadata then stopping #7540

Closed
Scripter17 opened this issue Jul 11, 2023 · 6 comments · Fixed by #8449
Closed

Allow for downloading metadata then stopping #7540

Scripter17 opened this issue Jul 11, 2023 · 6 comments · Fixed by #8449
Assignees
Milestone

Comments

@Scripter17
Copy link

Scripter17 commented Jul 11, 2023

Is your feature request related to a problem? Please describe.
I frequently use a DHT crawler called BTDigg to find torrents. Often the torrents can be 100+GB when all I want is a single 200MB video. Often the torrents are also old with few (if any) seeders that are only online once in a while. A few days ago I left an 18GB torrent downloading just so I can get the metadata then choose which files to download. Instead I woke up to it being 70% downloaded

Describe the solution you'd like
In addition to the start/stop button for torrents, add a button to wait for metadata then stop the torrent

Describe alternatives you've considered
Keeping Tribler open on my second monitor, keeping an eye on it, and pausing the torrents when I go to bed. This is obviously more of a pain than it needs to be and doesn't work well if the only seeder is on the other side of the world (time zones)

Alternatively Tribler could keep trying to find the metadata for stopped torrents, but that seems unintuitive and people generally want the stop button to mean stop

Additional context
Add any other context or screenshots about the feature request here.

@xoriole xoriole added this to the Backlog milestone Jul 11, 2023
@xoriole
Copy link
Contributor

xoriole commented Jul 11, 2023

@Scripter17 Thank you for the feature request.

It is already possible to select the files to download when starting a download on Tribler.
In the screenshot below, I selected only one file to download.
Screenshot 2023-07-11 at 08 55 48

@Scripter17
Copy link
Author

I should've clarified: That's only possible when someone who has the metadata is online and the torrent/magnet link contains the metadata

BTDigg, unfortunately, only has magnet links without that metadata

@qstokkink
Copy link
Contributor

Cross-post: #8286 (comment) - should be considered when fixing this issue.

@qstokkink
Copy link
Contributor

[Oops, misposted here first]

According to the (torrent_flags_t) docs:

In order to stop a torrent once the metadata has been downloaded, instead set all file priorities to dont_download

Of course, we might not know what files are in the torrent yet - so we'd have to start these torrents with the stop_when_ready flag in the ATP. Then, once the metadata is resolved, set all the file priorities to 0.

That said, to determine if we have to set the file priorities to 0, we need to review the ATP when transitioning from from a tdef without metainfo to a tdef with metainfo (or add a custom flag to the latter). One option is to add the ATP to the tdef here:

@qstokkink
Copy link
Contributor

qstokkink commented Feb 19, 2025

Actually, regarding the other issue: I think there is an even easier way to do this. Instead of storing the entire ATP, we can make use of an existing alert:

def on_metadata_received_alert(self, alert: lt.metadata_received_alert) -> None:

We still need to attach a new flag to the TorrentDefNoMetainfo for these "stop after metadata" downloads then, though.

EDIT: Perhaps persisting this in the DownloadConfig is easier. We'll have to check.

@qstokkink qstokkink assigned qstokkink and unassigned qstokkink Feb 19, 2025
@qstokkink
Copy link
Contributor

We can add a checkbox to the SaveAs dialog that disappears once the metadata is available. I'm thinking of the following.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants