Repository: internetarchive/openlibrary

Issue:
ImportBot Archive.org Imports Failing (403)
ImportBot's logs show a bunch of errors, and it seems like it's not successfully import/syncing new IA records.

### Evidence / Screenshot (if possible)
```
importbot_1         | 2021-01-21 18:43:06 [178] [openlibrary.importer] [INFO] sleeping for 5 seconds before next attempt.
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.api] [INFO] POST /api/import/ia
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.importer] [WARNING] Failed to contact OL server. error=403 Client Error: Forbidden for url: https://openlibrary.org/api/import/ia. Response:
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.importer] [ERROR] failed with internal error
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.imports] [INFO] set-status professioncallgi0000luca - failed internal-error None
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.importer] [INFO] importing istanbultocairoo0000hump
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.api] [INFO] POST /api/import/ia
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.importer] [WARNING] Failed to contact OL server. error=403 Client Error: Forbidden for url: https://openlibrary.org/api/import/ia. Response:
importbot_1         | 2021-01-21 18:43:11 [178] [openlibrary.importer] [INFO] sleeping for 5 seconds before next attempt.
importbot_1         | 2021-01-21 18:43:16 [178] [openlibrary.api] [INFO] POST /api/import/ia
importbot_1         | 2021-01-21 18:43:17 [178] [openlibrary.importer] [WARNING] Failed to contact OL server. error=403 Client Error: Forbidden for url: https://openlibrary.org/api/import/ia. Response:
importbot_1         | 2021-01-21 18:43:17 [178] [openlibrary.importer] [INFO] sleeping for 5 seconds before next attempt.
importbot_1         | 2021-01-21 18:43:22 [178] [openlibrary.api] [INFO] POST /api/import/ia
importbot_1         | 2021-01-21 18:43:22 [178] [openlibrary.importer] [WARNING] Failed to contact OL server. error=403 Client Error: Forbidden for url: https://openlibrary.org/api/import/ia. Response:
```


### Proposal & Constraints
<!-- What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere? -->

### Related files
<!-- Files related to this issue; this is super useful for new contributors who might want to help! If you're not sure, leave this blank; a maintainer will add them. -->

### Stakeholders
@mekarpeles 



Discussion:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/api.py#L199
```
class OpenLibrary:
    [ ... ]
    def import_ocaid(self, ocaid, require_marc=True):
        data = {'identifier': ocaid, 'require_marc': 'true' if require_marc else 'false'}
        return self._request('/api/import/ia', method='POST', data=data).content
```

Changes were merged in #4338 at https://github.com/internetarchive/openlibrary/pull/4338/files#diff-98d7771bbe1a01f48c8c4ba4c35ad68667c1fd5c28916a531f4bf624322610eeL201-R201

Resolving patch:
diff --git a/openlibrary/api.py b/openlibrary/api.py
--- a/openlibrary/api.py
+++ b/openlibrary/api.py
@@ -29,6 +29,7 @@
 
 logger = logging.getLogger("openlibrary.api")
 
+
 class OLError(Exception):
     def __init__(self, e):
         self.code = e.response.status_code
@@ -198,7 +199,7 @@ def unlimited_query(q):
 
     def import_ocaid(self, ocaid, require_marc=True):
         data = {'identifier': ocaid, 'require_marc': 'true' if require_marc else 'false'}
-        return self._request('/api/import/ia', method='POST', data=data).content
+        return self._request('/api/import/ia', method='POST', data=data).text
 
 
 def marshal(data):


Test patch: