Forum Settings
Forums

my_status being set to 0 when attempting to set manga status [Python]

New
Feb 20, 2017 1:34 PM
#1

Offline
Feb 2008
428
Hi, I am trying to update the status of a list entry on a manga list however I'm finding that the my_status attribute of a manga entry is getting set to 0 instead of 1, 2, 3, 4 or 6 as set.

So the XML is the following:
xml = """<?xml version="1.0" encoding="UTF-8"?>
<entry>
    <status>{}</status>
</entry>
""".format(new_status)

And then the request is made via the API:
r = requests.get("https://myanimelist.net/api/mangalist/update/23390.xml?data=" + xml, auth=(username, password))

Now this approach works perfectly for score, volumes, chapters, etc. without any issue, but yet when I try and do this for status is gets set back to 0 (confirmed when I look it up via the malappinfo page, see the Attack on Titan entry on 5hredTest malappinfo).

I'm getting status codes 200 so it appears to be successful at first glance, so I'm not really sure what's happening. I've stepped through my code to double-check that the correct int is being sent to the server.

Any suggestions would be appreciated.
Reply Disabled for Non-Club Members
Mar 10, 2017 12:20 PM
#2
Offline
May 2015
9
You need to send a POST request with body data=<your xml>. Also the valid values for <status> in the case of Anime are:
 1|watching, 2|completed, 3|onhold, 4|dropped, 6|plantowatch
Mar 10, 2017 12:25 PM
#3

Offline
Feb 2008
428
Hi, thanks for your reply. I managed to get it working using GET, I'm not sure what exactly was causing this but I changed it to something like:
url = "https://myanimelist.net/api/mangalist/update/{}.xml".format(id)
r = requests.get(url, params={"data": xml} auth=credentials)

It works fine now as far as I can tell.
5hreddyMar 10, 2017 12:29 PM
Mar 10, 2017 3:03 PM
#4
Offline
May 2015
9
Glad you got it working. Nevertheless I'd suggest that you still change to a POST request, which the official API requires, to avoid any future trouble.
Jul 24, 2017 7:49 PM
#5
Offline
Dec 2015
10
You say suggest using POST but POST actually always errored for me, changing it to a GET fixed it pretty quickly
Reply Disabled for Non-Club Members

More topics from this board

» I made a new anime recommendation system for MyAnimeList

Asudox - Mar 21

4 by Asudox »»
Apr 11, 2:58 PM

» API Rate Limit?

Asudox - Jan 23

7 by pepeefirat »»
Mar 23, 3:57 AM

» Cant build the URL

tamcio_ - Dec 4, 2022

3 by INVADER056 »»
Mar 18, 1:56 AM

» Some Animes Missing on API Reponse

Niccol0 - Jan 26

3 by ZeroCrystal »»
Mar 15, 3:44 PM

» [HELP] oAuth 2.0 Grant Type doesnt accept authorization_code

BlumexUser - Aug 30, 2022

2 by KaleabTeweld »»
Mar 14, 1:35 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login