#๐ python scrip to download files failing
44 messages ยท Page 1 of 1 (latest)
@lofty kestrel
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
this is the error message
PS C:\Users\kingf> & C:/Users/kingf/AppData/Local/Programs/Python/Python313/python.exe c:/Users/kingf/download_script.py
Download started for: https://www.thingiverse.com/thing:2813926
Renamed 'Aquarium Hideout Rock - 2813926.zip' to '442.zip'
Download started for: https://www.thingiverse.com/thing:2787780
Renamed '442.zip' to '443.zip'
An error occurred with https://www.thingiverse.com/thing:2787780: Message: disconnected: not connected to DevTools
(failed to check if window was closed: disconnected: not connected to DevTools)
(Session info: MicrosoftEdge=129.0.2792.89)
Stacktrace:
GetHandleVerifier [0x00007FF70072CEF5+12997]
Microsoft::Applications::Events::EventProperty::empty [0x00007FF7009ABD24+1897988]
(No symbol) [0x00007FF7004DF1CC]
(No symbol) [0x00007FF7004C868C]
(No symbol) [0x00007FF7004C92EF]
(No symbol) [0x00007FF7004DF738]
(No symbol) [0x00007FF7004BA60D]
(No symbol) [0x00007FF7005551D8]
(No symbol) [0x00007FF700554EDD]
(No symbol) [0x00007FF700547F10]
(No symbol) [0x00007FF70051B5AC]
(No symbol) [0x00007FF70051AA8D]
(No symbol) [0x00007FF70051B171]
UPDATE: Added model, "Aquarium_Hideou_Rock_Large Supports.stl, with updated supports. These seem to print better. This should also severely reduce the amount of support material need to print the object. I needed a hiding spot for a male Molly in my classroom fish tank to hide due to an aggressive "alpha" male molly. So I remixed "Rock 5 - Solid...
:incoming_envelope: :ok_hand: applied timeout to @lofty kestrel until <t:1728780293:f> (10 minutes) (reason: emoji spam - sent 24 emojis).
The <@&831776746206265384> have been alerted for review.
!code
this is my code
but it just renames the already renmaed one
any idea how to fix
it also waits 1 minute before opening the next url where it should only wait 5 second and open the next in a new tab and only close the first one after 60 seconds
I am trying to get it working on my own machine
nvm I saw the problem
if I understood properly the original problem is that the same file is getting renamed right?
the problem is in the if statement check you have to do the index - 1
like this
if filename.endswith(".zip") and not filename.startswith(str(file_index - 1)):
wait no
one sec
first time trying to program anything
the problem is that when you update the file index for example after the first run
the file index is now 443
so when it goes through and sees the file index 442.zip it's like woah thats not the index that's supposed to be there and renames that
i see
so how would i fix this, should i try see how to add a way to check if the previouse number is there and if it is to skip that file an look for a diffrent one
I have a question will all of the files you downald
will they always start with a letter
like I mean will the file name start with a number?
you could do that but that would make the time increase exponentially and the more urls you add the longer the program will take
they should all start with a letter
ok then what we can do is just check for all the files if the name of the file starts with a letter we rename it but if not then we skip it
the program is supposed to do this with a few hundred thousand * urls
in this case i was thinking of writing a new scrip, after they are all downloaded renamed them starting from the oldest download to the most recent as to save time
you could do that as well yes but you could also just change the condiiton in the if statement to
if filename.endswith(".zip") and not filename[0].isdigit()
which checks if the first charecter in the file is a digit
also to make it faster
instead of calling the rename function everysingle run of the downald thing
you could move to after the for loop
at the end of the thing
I will give that a try thank you
alright and if there is any errors please post it back here so I can help
you are welcome
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.