eigengrau / tts-backup

Backup Tabletop Simulator saves and assets into comprehensive Zip files.
GNU General Public License v3.0
111 stars 21 forks source link

Error 403 (Forbidden) on paste.ee #4

Closed liebig closed 7 years ago

liebig commented 7 years ago

I got Error 403 (Forbidden) erros while prefatching files from paste.ee. It seems that this always happens on paste.ee but if I open the page with the browser, I got no error. You will get this error with Mage Knigth. Please fix this, because your tool is awesome. Thanks.

eigengrau commented 7 years ago

paste.ee blocks Python’s default HTTP user-agent string. If you are running the code from git, you can check out the wip-useragent branch, which will pass along a custom user-agent by default or allow you to set the agent manually. I wasn’t able to test this yet, but I’ll try later tonight.

liebig commented 7 years ago

Thanks for the fast reply. I am using the Windows binaries. Can I change the default HTTP user-agent String with the binaries, too? I would like to use Chromes Win10 user-agent String, because it is the most common user agent. Maybe it is a good idea to use this String as default?

eigengrau commented 7 years ago

I decided against faking a browser’s user-agent string since it’s slightly impolite to do this by default, but the added option will allow you to set this manually. I’ll regenerate the binaries after testing the changes (probably tonight CET).

liebig commented 7 years ago

That sounds great. Thank you.

eigengrau commented 7 years ago

Turns out I still had wine and cx_freeze setup here, so I generated a new binary ZIP. Can you test this (maybe run prefetch and backup on a mod or two) and let me know if everything still works as expected, and whether this fixes the issue with paste.ee? I don’t have any JSON files handy.

liebig commented 7 years ago

Wow, you are really fast. I will test it this evening and will reply.

eigengrau commented 7 years ago

Seems to work! Let me know if you run into any issues I’ve overlooked.

eigengrau commented 7 years ago

BTW, updating my mods made me notice that TTS mods include a new asset type now, «assetbundles». I’ve added support for these now, but only one of my mods is actually using them. So, if you spot more of them give it a spin and see if everything fetches & backs up as intended.

liebig commented 7 years ago

I am sorry but it is not working on windows like it should. If I run the tts-backup.exe I get this message: image and with tts-prefetch.exe this error: image If I run the GUI, it is starting, but seems not to download the files probably. If I click download, I don't get messages in the log and the Stop and Quit Buttons are not working. Can you please check this?

eigengrau commented 7 years ago

Whoops. Not sure what happened there. Could be that I froze the binaries from a messed up Wine prefix (hence the odd paths; though it’s weird the issue didn’t crop up when testing this under Wine). Anyway, I regenerated the files from a fresh prefix and tested them from a Win10 VM. Can you grab the updated ZIP file and confirm?

liebig commented 7 years ago

I am sorry, but I still have problems. If I enter any User-Agent, the download does not run. Nothing is happening. For example Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36. But if I leave the string empty, it is running. The download on paste.ee does work with a blank user agent string.

eigengrau commented 7 years ago

There was a silly mistake in passing the user-agent from the prefetch GUI. Can you retry with the latest ZIP file?