Skip to content

Commit 1959d4c

Browse files
committed
Update API documentation for version 0.8.20
1 parent 72c60d4 commit 1959d4c

File tree

7 files changed

+1991
-66
lines changed

7 files changed

+1991
-66
lines changed

docs/scrapfly/api_response.html

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,13 @@ <h1 class="title">Module <code>scrapfly.api_response</code></h1>
477477

478478
if content_format in [&#39;clob&#39;, &#39;blob&#39;]:
479479
api_result[&#39;result&#39;][&#39;content&#39;], api_result[&#39;result&#39;][&#39;format&#39;] = self.large_object_handler(callback_url=api_result[&#39;result&#39;][&#39;content&#39;], format=content_format)
480-
elif content_format == &#39;binary&#39; and isinstance(api_result[&#39;result&#39;][&#39;content&#39;], bytes):
481-
api_result[&#39;result&#39;][&#39;content&#39;] = BytesIO(b64decode(api_result[&#39;result&#39;][&#39;content&#39;]))
480+
elif content_format == &#39;binary&#39;:
481+
base64_payload = api_result[&#39;result&#39;][&#39;content&#39;]
482+
483+
if isinstance(base64_payload, bytes):
484+
base64_payload = base64_payload.decode(&#39;utf-8&#39;)
485+
486+
api_result[&#39;result&#39;][&#39;content&#39;] = BytesIO(b64decode(base64_payload))
482487

483488
return FrozenDict(api_result)
484489

@@ -1690,8 +1695,13 @@ <h3>Methods</h3>
16901695

16911696
if content_format in [&#39;clob&#39;, &#39;blob&#39;]:
16921697
api_result[&#39;result&#39;][&#39;content&#39;], api_result[&#39;result&#39;][&#39;format&#39;] = self.large_object_handler(callback_url=api_result[&#39;result&#39;][&#39;content&#39;], format=content_format)
1693-
elif content_format == &#39;binary&#39; and isinstance(api_result[&#39;result&#39;][&#39;content&#39;], bytes):
1694-
api_result[&#39;result&#39;][&#39;content&#39;] = BytesIO(b64decode(api_result[&#39;result&#39;][&#39;content&#39;]))
1698+
elif content_format == &#39;binary&#39;:
1699+
base64_payload = api_result[&#39;result&#39;][&#39;content&#39;]
1700+
1701+
if isinstance(base64_payload, bytes):
1702+
base64_payload = base64_payload.decode(&#39;utf-8&#39;)
1703+
1704+
api_result[&#39;result&#39;][&#39;content&#39;] = BytesIO(b64decode(base64_payload))
16951705

16961706
return FrozenDict(api_result)
16971707

@@ -2099,8 +2109,13 @@ <h3>Methods</h3>
20992109

21002110
if content_format in [&#39;clob&#39;, &#39;blob&#39;]:
21012111
api_result[&#39;result&#39;][&#39;content&#39;], api_result[&#39;result&#39;][&#39;format&#39;] = self.large_object_handler(callback_url=api_result[&#39;result&#39;][&#39;content&#39;], format=content_format)
2102-
elif content_format == &#39;binary&#39; and isinstance(api_result[&#39;result&#39;][&#39;content&#39;], bytes):
2103-
api_result[&#39;result&#39;][&#39;content&#39;] = BytesIO(b64decode(api_result[&#39;result&#39;][&#39;content&#39;]))
2112+
elif content_format == &#39;binary&#39;:
2113+
base64_payload = api_result[&#39;result&#39;][&#39;content&#39;]
2114+
2115+
if isinstance(base64_payload, bytes):
2116+
base64_payload = base64_payload.decode(&#39;utf-8&#39;)
2117+
2118+
api_result[&#39;result&#39;][&#39;content&#39;] = BytesIO(b64decode(base64_payload))
21042119

21052120
return FrozenDict(api_result)</code></pre>
21062121
</details>

0 commit comments

Comments
 (0)