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

As a result of using it, it seems that I cannot get the 'date' value. #56

Open
omk9307 opened this issue Feb 7, 2021 · 0 comments
Open

Comments

@omk9307
Copy link

omk9307 commented Feb 7, 2021

Thanks for the good code.

But I wanted to put the date in the file name using -n {date:%Y-%m-%d}
It doesn't work..

As a result of checking a little bit, all the'date' values stored in the variable resources appear as 'None'.

So it seems that the following error appears.

ractically scan 853 weibos, get 1837 resources
Traceback (most recent call last):
File "D:\weibo\weiboPicDownloader.py", line 377, in
path = os.path.join(album, format_name(resource))
File "D:\weibo\weiboPicDownloader.py", line 286, in format_name
return safeify(re.sub(r'{(.*?)}', substitute, args.name))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "D:\weibo\weiboPicDownloader.py", line 278, in substitute
return item[key[0]].strftime(key[1]) if len(key) > 1 else str(item[key[0]])
AttributeError: 'NoneType' object has no attribute 'strftime'

Could you please give me a solution?

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

1 participant