-
Notifications
You must be signed in to change notification settings - Fork 7
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
Sub extension fix #13
Conversation
Hi, about the '.part' line that you removed: #4. I need that feature to stay. Benoit, what was the intention behind the isfile line? |
I think the new remove_extension behaves better. It is sound that the input and output be in the same directory. For example,
|
I'm OK with this. Please support .part files in remove_extension, something like def remove_extension(filename):
filename, ext = os.path.splitext(filename)
if ext == '.part':
filename, ext = os.path.splitext(filename)
return filename Also, if you know git, please rebase this pull request into one or two clean commits (at least, no merge commit). Else I'll do it. |
Hi Benoit and Joel, I started looking at your code because I wanted to create a similar program and have found your. I didn't realized the .part is actually needed when you are downloading a file (I naively though the file would be called something like "the.file.part" rather than "the.file.mp4.part". About git rebase, sorry I have never used it, but will look into how to use it to have a cleaner history. Thanks again guys. |
@@ -382,7 +376,10 @@ def normalize_release(release): | |||
|
|||
|
|||
def remove_extension(filename): | |||
return filename.rpartition('.')[0] if '.' in filename else filename | |||
filename, ext = os.path.splitext(filename) | |||
if ext in ['.part','.!qB']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to manage also partial downloads using qBittorrent (and updating the list one can handle other softwares that append a suffix to the file while downloading).
Bugfix. When the video file is not present in the directory the subtitle was downloaded with the same name provided in input. This commit redefines 'remove_extension' and fix this.
…i into sub_extension_fix
Hi,
I noticed that if you call addic7ed somefile.avi, but the avi file is not in the directory,
then the subtitle is dowloade with the name of the file, rather than with the correct .srt extension.
E.g.:
addic7ed an_episode_name.avi
downloads the subtitle as "an_episode_name.avi" rather than as "an_episode_name.srt".
This commit fix this.