tommyblue / smugmug-backup

Makes a full backup of a SmugMug account

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting error message upon running the script

wimmulder opened this issue · comments

I have installed everything according to the instructions and exported the API and USER keys and secrets. Upon running the script I get the following errors (x3)

Getting albums for user [username]...
404 Not Found

https://api.smugmug.com: reading response
[ERR] invalid character '<' looking for beginning of value

Any idea what might be causing this?

Hi @wimmulder thanks for reporting this issue.
The invalid character message is probably caused by the json parser that tries to parse the response as json while it isn't (due to the 404). I really need to add some response code checking 😄
Do the console shows more messages?

Could you also help me debug some calls:

  • Open with the browser https://api.smugmug.com/api/v2/user/<username>
  • Does that page contains the path Response.User.Uris.UserAlbums.URI?
  • Its value should be https://api.smugmug.com/api/v2/user/<username>!albums, is it? Could you open this page too?
  • https://api.smugmug.com/api/v2/user/<username>!albums should contain the path Response.Pages.NextPage

Hey @tommyblue
Just checked for you. It does contain UserAlbums. The value is /api/v2/user/wimmulder!albums. When I open that URL the NextPage value is /api/v2/user/wimmulder!albums?start=51&count=50. Any of the endpoints I look up give me a 200 OK response. Let me know if there are any other steps to help you figure this out. Thanks for your reply!

This is the full response I get when running the script:
Getting albums for user wimmulder@gmail.com...
2019/06/20 10:22:30 404 Not Found
2019/06/20 10:22:30 404 Not Found
2019/06/20 10:22:30 404 Not Found
2019/06/20 10:22:32 https://api.smugmug.com: reading response
[ERR] invalid character '<' looking for beginning of value
2019/06/20 10:22:33 https://api.smugmug.com: reading response
[ERR] invalid character '<' looking for beginning of value
2019/06/20 10:22:34 https://api.smugmug.com: reading response
[ERR] invalid character '<' looking for beginning of value
Found 0 albums

The problem is the username, it's wimmulder@gmail.com but should be wimmulder. Try changing the value of the -user param

I updated the README to help people identify the username

I can't believe I didn't think of that, that fixed the problem! I never thought about it because I login using my e-mail address. Looks like the script is chugging along now, thanks so much!

What does exit status 1 mean by the way?