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

feature request: allow user to choose where the file gets saved to. #4

Closed
bcornw2 opened this issue Jun 25, 2020 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@bcornw2
Copy link

bcornw2 commented Jun 25, 2020

Hello,

I've been playing with this all day and I gotta say, its pretty great. I know its new, and I was hoping you might add functionality to choose a location where you save the video, instead of the current directory. I know that in a python script, I could "os.chdir(path)", but that seems to have trouble, and I get "[Errno 18] Invalid cross device link", even though it actually works correctly - (sometimes when it merges audio and video, it doesn't delete the .m4a and the video.mp4 file, even though the finish product works well).

Also, I noted that your TODO says you want to add gif functionality - just wanted to let you know that I tested this with gifs and it already works (but saves it as .mp4 format - that works fine for my purposes, but I understand if people want .gif natively).

Thanks,

Ben

@elmoiv elmoiv added the enhancement New feature or request label Jun 26, 2020
@elmoiv
Copy link
Owner

elmoiv commented Jun 26, 2020

I think it is better to fork the repo and add a pull request after you add your desired features.
You deserve to be a contributor :)

And don't worry about anything after I patch your pull request. Everything will be fixed.

@bcornw2
Copy link
Author

bcornw2 commented Jun 26, 2020

I'll take a swing at it, but I am not a great coder. Stay tuned tho!

@elmoiv
Copy link
Owner

elmoiv commented Jun 30, 2020

Added this feature:

...
    def __init__(self, url='', path='', max_quality=False, min_quality=False, proxies={}):
        self.proxies = proxies
        self.max, self.min = m...
...

So now you can now choose where the file gets saved to by doing this:

from redvid import *
Reddit = Downloader()
Reddit.path = 'YOUR PATH'
Reddit.url = 'VIDEO URL'
Reddit.download()

Now working on the other features. When Everything is ready I will update the repo.

Stay tuned!

@elmoiv
Copy link
Owner

elmoiv commented Jul 1, 2020

Feature added.

@elmoiv elmoiv closed this as completed Jul 1, 2020
@cmicek1
Copy link

cmicek1 commented Jul 10, 2020

Yeeeaaahh this is kinda broken, at least for me on windows. You change the working directory a few places (e.g. line 30 in redvid.py, and line 56 in tools.py), and then leave references to the full path lying around (in the name of the saved video, for example), so saving files doesn't work, since the path you're trying to save to is relative to your original location.

@cmicek1
Copy link

cmicek1 commented Jul 10, 2020

Good news though is it's a one-line fix: change
self.path, self.url, self.proxies = path, url, proxies
to
self.path, self.url, self.proxies = os.path.abspath(path), url, proxies
on line 18 of redvid.py.
I think you were enforcing absolute paths without stating that you were.

Edit: Maybe not one line; you want to return to the previous working directory when the download is done.

@elmoiv
Copy link
Owner

elmoiv commented Jul 10, 2020

@cmicek1
Please follow issue template included in the repository to make it easier to deal with your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants