Giter Site home page Giter Site logo

Comments (4)

mtshrmn avatar mtshrmn commented on June 11, 2024

This is a great feature to have. The only problem I have is getting a callback when an episode has finished downloading. When the download process is managed with python (at the current version), I simply block the main script when downloading, and when the download is done, the script is unblocked again and can update the downloaded file in it's config file.

# once this is done, only then the following part will continue
download(episode_obj, QUALITIES, abs_path)

# update the downloaded file in config
if not args.download:
    CONFIG.conf["subscriptions"][episode_obj["title"].lower()] = episode_obj["episode"].lstrip("0")
    with open(os.path.join(CONFIG.dir, CONFIG.file), "w") as f:
        CONFIG.conf.write(f)

With your idea, once the magnet is sent to a detached process, I have no control over it and I have no idea when the file has finished downloading. If you can find a solution for this, I'll be more than glad to add this.

from horrible-downloader.

FlamingCupcake avatar FlamingCupcake commented on June 11, 2024

Specifically for Deluge, the call to add a magnet link returns a torrent_id, which can then be used with the core.get_torrent_status call to get the current state of the torrent. You could then use it like this:

torrent_id = self.deluge.call('core.add_torrent_magnet', magnet_link, {'download_location': output_dir,})

torrent_status = self.deluge.call('core.get_torrent_status', torrent_id, ['state'])
while torrent_status[b'state'] != b'Seeding':
    time.sleep(3)
    torrent_status = self.deluge.call('core.get_torrent_status', torrent_id, ['state'])

from horrible-downloader.

mtshrmn avatar mtshrmn commented on June 11, 2024

In that case, I think your implementation idea is good, and if you can implement it, ill add it.
Sorry for not responding fast, I don't have access to a computer most of the time.

from horrible-downloader.

mtshrmn avatar mtshrmn commented on June 11, 2024

Closed due to inactivity.

from horrible-downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.