Code Monkey home page Code Monkey logo

Comments (10)

Dabbing-Guy avatar Dabbing-Guy commented on May 23, 2024 2

I figured out the issue:

    def download_video(self):
        try:
            path = download(self.entry).download()
            if Config().auto_open_dl:
                player_command = ["mpv", str(path)]
                if os.name in ("nt", "dos"):
                    sp.Popen(player_command)
                else:
                    sp.Popen(player_command, stdout=sp.PIPE, stderr=sp.DEVNULL)

        except: #TODO: Make some error for download fail
            pass

        self.print_status()
        self.print_opts()

Above is the newly implemented function that is called when d is used in the cli interface. The issue with it is that Config().auto_open_dl does not exist. It is actually Config().auto_open_dl_defaultcli. Also, the string "mpv" is used instead of Config().player_path. The reason why an exception is not raised when using this is because this part of the code is in a try except statement that has an empty except part. This catches the error so it is harder to understand why this is not working. @sdaqo please avoid writing try except statements that don't catch explicit exceptions in the future. Also consider using a linter for python so you can see when you are using variables that don't exist.

from anipy-cli.

sdaqo avatar sdaqo commented on May 23, 2024 1

A good idea. Implemented it. I also implemented a option you can set (auto_open_dl_defaultcli) in the config that auto opens the file after the download. Have fun.

from anipy-cli.

Prashanthvsdvn avatar Prashanthvsdvn commented on May 23, 2024

Hey! Thanks for the immediate commit. The download option works as intended. However, the option to auto open after download doesn't.

Sadly, I don't have any trace back or outputs that I can post it for debugging. It just doesn't auto opens after download.

However, when I try to re-download the episode, I can see Skipping already existing for a split second.
Let me know, if I can do anything to sort this issue out and we can close this.

from anipy-cli.

Dabbing-Guy avatar Dabbing-Guy commented on May 23, 2024

However, when I try to re-download the episode, I can see Skipping already existing for a split second.

So, the downloading feature works. You got this message because the anime you were trying to download was already in you downloads file.

from anipy-cli.

sdaqo avatar sdaqo commented on May 23, 2024

Yes, the player is probably not opening because either the option is not correctly set in the config or it's a windows problem, since it works fine on my Linux machine.

from anipy-cli.

Dabbing-Guy avatar Dabbing-Guy commented on May 23, 2024

@Prashanthvsdvn can you send us your config file?

from anipy-cli.

Prashanthvsdvn avatar Prashanthvsdvn commented on May 23, 2024

However, when I try to re-download the episode, I can see Skipping already existing for a split second.

So, the downloading feature works. You got this message because the anime you were trying to download was already in you downloads file.

Yes, I was just trying to trigger the auto play option after the download.

from anipy-cli.

Prashanthvsdvn avatar Prashanthvsdvn commented on May 23, 2024

@Prashanthvsdvn can you send us your config file?

anipy_cli_folder : 'C:\Users\Prashanth\.anipy-cli'
download_folder_path : 'D:\Videos\Anime'
download_name_format : '{show_name}_{episode_number}.mp4'
download_remove_dub_from_folder_name : False
dc_presence : True
player_path: 'mpv'
auto_open_dl_defaultcli: True

from anipy-cli.

sdaqo avatar sdaqo commented on May 23, 2024

True, I committed the change to the property name in a separate commit without changing it in the if statement, to that's probably why it worked for me before.

from anipy-cli.

Prashanthvsdvn avatar Prashanthvsdvn commented on May 23, 2024

Just tested out the change. The playback after downloading works. Closing the issue. Thank you both of you.

from anipy-cli.

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.