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

Failed with sub-folders #10

Open
haindvn opened this issue Feb 16, 2020 · 2 comments
Open

Failed with sub-folders #10

haindvn opened this issue Feb 16, 2020 · 2 comments

Comments

@haindvn
Copy link

haindvn commented Feb 16, 2020

It took me a while to debug to see the problem.
The following example code on the front page will fail if we have any sub-folder in the main folder, we can check the key furl to check whether it's a folder or a file prior to call download function on that link to avoid script fail (the exception "Link is dead" is not meaningful in this case).

I include the check in my script: https://github.com/haindvn/FShareDownloader
(fdownload.py line #137)

from get_fshare import FSAPI

URL = 'https://www.fshare.vn/folder/THFVWDY4YT'

bot = FSAPI(email="Your email", password="Your password")
bot.login()
sillicon_valley_ss1 = bot.get_folder_urls(URL)

for episode in sillicon_valley_ss1:
    # Should check whether it's a file or folder, sometime we have sub-folder.
    print(episode['name'], bot.download("https://www.fshare.vn/file/{}".format(episode['linkcode'])))
@tudoanh
Copy link
Owner

tudoanh commented Feb 25, 2020

If you can fix it, please make a PR :D

@haindvn
Copy link
Author

haindvn commented Mar 1, 2020

Noted, I will make some fixes and will PR :)

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

No branches or pull requests

2 participants