Comments (10)
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.
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.
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.
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.
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.
@Prashanthvsdvn can you send us your config file?
from anipy-cli.
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 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.
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.
Just tested out the change. The playback after downloading works. Closing the issue. Thank you both of you.
from anipy-cli.
Related Issues (20)
- Program crashes after it finishes downloading seasonals HOT 5
- Suggestion: format json file with newlines and indents HOT 1
- 'mpv' module cannot be found HOT 3
- wrong label in README HOT 1
- Set one folder as the location for seasonals downloads HOT 9
- Downloading an episode causes the program to crash HOT 1
- Connection issues with gogohd HOT 6
- Small bug in MAL-Mode cli HOT 1
- Make mal authentication more secure HOT 25
- Config not being generated HOT 8
- Randomly creates random extensions for tmp files HOT 17
- Dubs not available in search HOT 14
- JSON decode error when trying to play episodes HOT 3
- Download broken (response code:502) HOT 2
- Program crashes on startup HOT 2
- Error when running Anipy-cli: OSError: FFmpeg version command returned an error HOT 2
- JSON decode error while syncing from MAL HOT 3
- Need to clean titles with special Character to valid filename characters HOT 6
- Connection Forced by Remote Host Error HOT 3
- Adding an anime with 0 episodes into seasonal mode crashes program HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anipy-cli.