Radiquum / furaffinity-dl

FurAffinity Downloader, now with 100% more Python
MIT License
6 stars 1 forks source link

SyntaxError: f-string: unmatched '[' #8

Closed RemiSterling closed 4 hours ago

RemiSterling commented 4 hours ago

Attempting to run the python3 furaffinity-dl.py for favorites, with a cookie file I am seeing the following:

Traceback (most recent call last): File "/home/jurrel/Pictures/FA-Favs-Downloads/furaffinity-dl-python/furaffinity-dl.py", line 9, in from Modules.download import download File "/home/jurrel/Pictures/FA-Favs-Downloads/furaffinity-dl-python/Modules/download.py", line 9, in from Modules.functions import DownloadComplete File "/home/jurrel/Pictures/FA-Favs-Downloads/furaffinity-dl-python/Modules/functions.py", line 144 page_num = f"{parse_next_button.parent.attrs["action"].split("/")[-2]}/next" ^^^^^^ ##Broken spacing, this is under "action"## SyntaxError: f-string: unmatched '['

Using Python 3.10.12

Radiquum commented 4 hours ago

Hello, can you provide username for which this is happening? Also, do you use modern theme?

RemiSterling commented 4 hours ago

Sure under jurrel and yes I am using modern layout, dark theme. Screenshot from 2024-11-15 15-40-24

Radiquum commented 4 hours ago

hmm, strange, it seems to work fine for me. What command did you use? And in what page number does it happen?

I tried with this command: python .\furaffinity-dl.py jurrel favorites --dry -c .\cookies.txt

RemiSterling commented 4 hours ago

I am getting it as soon as I run the command. Attaching here everything from the command prompt:

python3 furaffinity-dl.py jurrel favorites -c www.furaffinity.net_cookies.txt Traceback (most recent call last): File "/home/jurrel/Pictures/FA-Favs-Downloads/furaffinity-dl-python/furaffinity-dl.py", line 9, in from Modules.download import download File "/home/jurrel/Pictures/FA-Favs-Downloads/furaffinity-dl-python/Modules/download.py", line 9, in from Modules.functions import DownloadComplete File "/home/jurrel/Pictures/FA-Favs-Downloads/furaffinity-dl-python/Modules/functions.py", line 144 page_num = f"{parse_next_button.parent.attrs["action"].split("/")[-2]}/next" ^^^^^^ SyntaxError: f-string: unmatched '['

I tried your command and got the same error, this is on linux, not that it should make a difference.

For what it is worth, I used an older version of this scripting before and it would work, but only ever get page 1 of favorites then say it could not find the next button.

Radiquum commented 4 hours ago

ooh, I maybe understand why that is happening. It seems like on python 3.12 double quotes inside double quotes are working fine, but in older versions like 3.10 they are not. I will try to replace them with single quotes, and give it another try, should be fixed shortly

Radiquum commented 4 hours ago

Can you update and try it again?

RemiSterling commented 4 hours ago

That was it! It is now pulling properly for several pages.

Radiquum commented 4 hours ago

Thanks for the issue. And sorry I didn't catch it sooner