Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4b08bce
feat(api): api update
stainless-app[bot] May 25, 2026
a67bd8b
feat(api): api update
stainless-app[bot] May 25, 2026
d22aec4
feat(api): api update
stainless-app[bot] May 25, 2026
f2f2094
feat(api): api update
stainless-app[bot] May 25, 2026
2b072d1
feat(api): api update
stainless-app[bot] May 26, 2026
0a74e45
feat(api): api update
stainless-app[bot] May 26, 2026
2c2c2d5
feat(api): api update
stainless-app[bot] May 26, 2026
196b012
feat(api): api update
stainless-app[bot] May 26, 2026
0babea3
feat(api): api update
stainless-app[bot] May 27, 2026
015b0d1
feat(api): api update
stainless-app[bot] May 27, 2026
af71d0c
feat(api): api update
stainless-app[bot] May 27, 2026
88c6d42
feat(api): api update
stainless-app[bot] May 27, 2026
0942b23
feat(api): api update
stainless-app[bot] May 27, 2026
9ffc9d3
feat(api): api update
stainless-app[bot] May 27, 2026
43559da
feat(api): api update
stainless-app[bot] May 28, 2026
cb29cb5
feat(api): api update
stainless-app[bot] May 29, 2026
9ce94a8
feat(api): api update
stainless-app[bot] Jun 1, 2026
62090dc
feat(api): api update
stainless-app[bot] Jun 2, 2026
3e7e17b
feat(api): api update
stainless-app[bot] Jun 2, 2026
3525475
feat(api): api update
stainless-app[bot] Jun 3, 2026
c06f3ab
feat(api): api update
stainless-app[bot] Jun 4, 2026
4594ec1
feat(api): api update
stainless-app[bot] Jun 4, 2026
43194d7
feat(api): api update
stainless-app[bot] Jun 4, 2026
9e94503
feat(api): api update
stainless-app[bot] Jun 5, 2026
de81294
feat(api): api update
stainless-app[bot] Jun 5, 2026
2952e4b
feat(api): api update
stainless-app[bot] Jun 5, 2026
f49b174
codegen metadata
stainless-app[bot] Jun 5, 2026
0155b06
codegen metadata
stainless-app[bot] Jun 5, 2026
db0732e
feat(api): api update
stainless-app[bot] Jun 5, 2026
b466abb
feat(api): api update
stainless-app[bot] Jun 5, 2026
fe65d3e
feat(api): api update
stainless-app[bot] Jun 6, 2026
924de03
feat(api): api update
stainless-app[bot] Jun 8, 2026
8ada88c
feat(api): api update
stainless-app[bot] Jun 9, 2026
aa704e0
feat(api): api update
stainless-app[bot] Jun 9, 2026
e64239d
feat(api): api update
stainless-app[bot] Jun 9, 2026
57a911a
feat(api): api update
stainless-app[bot] Jun 9, 2026
3551f5f
feat(api): api update
stainless-app[bot] Jun 11, 2026
8bbc9d6
feat(api): api update
stainless-app[bot] Jun 11, 2026
f0a25cd
feat(api): api update
stainless-app[bot] Jun 11, 2026
98a84e7
feat(api): api update
stainless-app[bot] Jun 11, 2026
6b9ad4e
feat(api): api update
stainless-app[bot] Jun 12, 2026
eb632d4
feat(api): api update
stainless-app[bot] Jun 12, 2026
a96c6d7
feat(api): api update
stainless-app[bot] Jun 12, 2026
06c6eef
feat(api): api update
stainless-app[bot] Jun 12, 2026
bbaa897
feat(api): api update
stainless-app[bot] Jun 12, 2026
afd3835
feat(api): api update
stainless-app[bot] Jun 12, 2026
56d3af6
feat(api): api update
stainless-app[bot] Jun 12, 2026
93058f9
release: 0.2.0
stainless-app[bot] Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.2"
".": "0.2.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 266
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-ba5efdf86108ef077f2db1f8a05b84d58f7f218fe2b7e0eb72e3c371cfa30015.yml
openapi_spec_hash: 6c2d47cd85674ece07dc37e471a36ac9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-bdf0ec6c222e345e512af7c9c9ddc55c0fa72d3860a8c8be3e747667c8c31a81.yml
openapi_spec_hash: af3728e576ac859886d59cc48d3a513d
config_hash: 397c91e15c0024f8b5bbed9b82c2348c
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# Changelog

## 0.2.0 (2026-06-12)

Full Changelog: [v0.1.2...v0.2.0](https://github.com/onlyfansapi/onlyfansapi-python/compare/v0.1.2...v0.2.0)

### Features

* **api:** api update ([56d3af6](https://github.com/onlyfansapi/onlyfansapi-python/commit/56d3af65bb3977a2fe5e4ba229cff154cd5fd3b6))
* **api:** api update ([afd3835](https://github.com/onlyfansapi/onlyfansapi-python/commit/afd3835d291685dc853fb3d65912f56dc623c485))
* **api:** api update ([bbaa897](https://github.com/onlyfansapi/onlyfansapi-python/commit/bbaa89714c89ec78261079236b42f2d5d1ddb930))
* **api:** api update ([06c6eef](https://github.com/onlyfansapi/onlyfansapi-python/commit/06c6eefd0f8f8cb4ee28d7977dd27e594f14c155))
* **api:** api update ([a96c6d7](https://github.com/onlyfansapi/onlyfansapi-python/commit/a96c6d73c2a5f5dfed976f2ec235b082c2569872))
* **api:** api update ([eb632d4](https://github.com/onlyfansapi/onlyfansapi-python/commit/eb632d41920d0f838135d5f1d66502298b430bcc))
* **api:** api update ([6b9ad4e](https://github.com/onlyfansapi/onlyfansapi-python/commit/6b9ad4e06d8663bb4a7959432dbdd1f253b3436e))
* **api:** api update ([98a84e7](https://github.com/onlyfansapi/onlyfansapi-python/commit/98a84e77ee2bf89462136939c7b6ddfd39a0c619))
* **api:** api update ([f0a25cd](https://github.com/onlyfansapi/onlyfansapi-python/commit/f0a25cd6b38cdae7c64dfeb113c489b216dda816))
* **api:** api update ([8bbc9d6](https://github.com/onlyfansapi/onlyfansapi-python/commit/8bbc9d67d84d394af2936841c24ca07f5cce0944))
* **api:** api update ([3551f5f](https://github.com/onlyfansapi/onlyfansapi-python/commit/3551f5fbba68388f3c5215acec8488b22b83bf30))
* **api:** api update ([57a911a](https://github.com/onlyfansapi/onlyfansapi-python/commit/57a911acb35d93fd2586a5ae34cc6fd708943b2e))
* **api:** api update ([e64239d](https://github.com/onlyfansapi/onlyfansapi-python/commit/e64239d0f6358f959e78a679908eddb39f8bff21))
* **api:** api update ([aa704e0](https://github.com/onlyfansapi/onlyfansapi-python/commit/aa704e0fa956d67a1551857fecfbceaf52a42b5c))
* **api:** api update ([8ada88c](https://github.com/onlyfansapi/onlyfansapi-python/commit/8ada88cd402259d9daa8cd20e95e3b44d67e0bf5))
* **api:** api update ([924de03](https://github.com/onlyfansapi/onlyfansapi-python/commit/924de03411c4481b1bf81c6b67dad9d5640c0916))
* **api:** api update ([fe65d3e](https://github.com/onlyfansapi/onlyfansapi-python/commit/fe65d3ebaaf73dd96c60fbb8dd96292e8b13ae5a))
* **api:** api update ([b466abb](https://github.com/onlyfansapi/onlyfansapi-python/commit/b466abb391150e3ce362ab9846f672facc69551f))
* **api:** api update ([db0732e](https://github.com/onlyfansapi/onlyfansapi-python/commit/db0732e227750931db1a25a278456fd7b95424fb))
* **api:** api update ([2952e4b](https://github.com/onlyfansapi/onlyfansapi-python/commit/2952e4b60838f01d8bd0e586249cd917d607cb62))
* **api:** api update ([de81294](https://github.com/onlyfansapi/onlyfansapi-python/commit/de812940595d4332b9f42d267f88f12c9783db1a))
* **api:** api update ([9e94503](https://github.com/onlyfansapi/onlyfansapi-python/commit/9e9450351d93e7a6bd02ac847569349ec71fddb5))
* **api:** api update ([43194d7](https://github.com/onlyfansapi/onlyfansapi-python/commit/43194d71262d5d50f797a8ccba2659a6c3c2887f))
* **api:** api update ([4594ec1](https://github.com/onlyfansapi/onlyfansapi-python/commit/4594ec136232b42f3d456b09516ec08065fdfafd))
* **api:** api update ([c06f3ab](https://github.com/onlyfansapi/onlyfansapi-python/commit/c06f3abf1381148f5e48b85f0086b1af17e2a0d3))
* **api:** api update ([3525475](https://github.com/onlyfansapi/onlyfansapi-python/commit/3525475272b3341f91f4b75160f63b106321e139))
* **api:** api update ([3e7e17b](https://github.com/onlyfansapi/onlyfansapi-python/commit/3e7e17b1e3ab8993aba06ffec2ef5378d18f93d2))
* **api:** api update ([62090dc](https://github.com/onlyfansapi/onlyfansapi-python/commit/62090dc02ca59eb6efec90625d71d312043b55a1))
* **api:** api update ([9ce94a8](https://github.com/onlyfansapi/onlyfansapi-python/commit/9ce94a833a666de930b770d1ba2c59596ff2d330))
* **api:** api update ([cb29cb5](https://github.com/onlyfansapi/onlyfansapi-python/commit/cb29cb5216eaf0bbbc57186287b11e829710b6a1))
* **api:** api update ([43559da](https://github.com/onlyfansapi/onlyfansapi-python/commit/43559da1af5ee18c58b99677f3cfd559e0e2106e))
* **api:** api update ([9ffc9d3](https://github.com/onlyfansapi/onlyfansapi-python/commit/9ffc9d354f805880d3363c4084fe49935a7a9d10))
* **api:** api update ([0942b23](https://github.com/onlyfansapi/onlyfansapi-python/commit/0942b231431790866d93cc2e477082c5aee0b87c))
* **api:** api update ([88c6d42](https://github.com/onlyfansapi/onlyfansapi-python/commit/88c6d42c3c75411714bd70c03322d76b7960208a))
* **api:** api update ([af71d0c](https://github.com/onlyfansapi/onlyfansapi-python/commit/af71d0ce89f943af5d27d66a5fbb1cd8e7285f9b))
* **api:** api update ([015b0d1](https://github.com/onlyfansapi/onlyfansapi-python/commit/015b0d11070c3801c8bb26ff99b2f7f1d9ad5627))
* **api:** api update ([0babea3](https://github.com/onlyfansapi/onlyfansapi-python/commit/0babea32599dc9d8603ba9e6519f9760367ad1f6))
* **api:** api update ([196b012](https://github.com/onlyfansapi/onlyfansapi-python/commit/196b0123732493210c74e905d55c82ceafee11b9))
* **api:** api update ([2c2c2d5](https://github.com/onlyfansapi/onlyfansapi-python/commit/2c2c2d5611f7d22371608b4e105d702fc96cbbd1))
* **api:** api update ([0a74e45](https://github.com/onlyfansapi/onlyfansapi-python/commit/0a74e45ef5ecbefdfb4b2d3ca47c04004f77ee18))
* **api:** api update ([2b072d1](https://github.com/onlyfansapi/onlyfansapi-python/commit/2b072d1cb4c48b00c3cd66616334e9edd580899d))
* **api:** api update ([f2f2094](https://github.com/onlyfansapi/onlyfansapi-python/commit/f2f2094213516b1f79af9f22dc03a84a2a074a1a))
* **api:** api update ([d22aec4](https://github.com/onlyfansapi/onlyfansapi-python/commit/d22aec4906882366899e5bef242bc1a6ca3ca7d6))
* **api:** api update ([a67bd8b](https://github.com/onlyfansapi/onlyfansapi-python/commit/a67bd8b1e7a96890aaf430233e80dcebf94e6aa0))
* **api:** api update ([4b08bce](https://github.com/onlyfansapi/onlyfansapi-python/commit/4b08bcecf591dcc5d35dad618d89d806cddab4b8))

## 0.1.2 (2026-05-25)

Full Changelog: [v0.1.1...v0.1.2](https://github.com/onlyfansapi/onlyfansapi-python/compare/v0.1.1...v0.1.2)
Expand Down
6 changes: 3 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,12 @@ Methods:
Types:

```python
from onlyfansapi.types import MediaDownloadResponse, MediaScrapeResponse, MediaUploadResponse
from onlyfansapi.types import MediaScrapeResponse, MediaUploadResponse
```

Methods:

- <code title="get /api/{account}/media/download/{cdnUrl}">client.media.<a href="./src/onlyfansapi/resources/media/media.py">download</a>(cdn_url, \*, account) -> str</code>
- <code title="get /api/{account}/media/download/{cdnUrl}">client.media.<a href="./src/onlyfansapi/resources/media/media.py">download</a>(cdn_url, \*, account) -> None</code>
- <code title="post /api/{account}/media/scrape">client.media.<a href="./src/onlyfansapi/resources/media/media.py">scrape</a>(account, \*\*<a href="src/onlyfansapi/types/media_scrape_params.py">params</a>) -> <a href="./src/onlyfansapi/types/media_scrape_response.py">MediaScrapeResponse</a></code>
- <code title="post /api/{account}/media/upload">client.media.<a href="./src/onlyfansapi/resources/media/media.py">upload</a>(account, \*\*<a href="src/onlyfansapi/types/media_upload_params.py">params</a>) -> <a href="./src/onlyfansapi/types/media_upload_response.py">MediaUploadResponse</a></code>

Expand Down Expand Up @@ -579,7 +579,7 @@ Methods:

- <code title="post /api/{account}/media/vault/lists">client.media.vault.lists.<a href="./src/onlyfansapi/resources/media/vault/lists/lists.py">create</a>(account, \*\*<a href="src/onlyfansapi/types/media/vault/list_create_params.py">params</a>) -> <a href="./src/onlyfansapi/types/media/vault/list_create_response.py">ListCreateResponse</a></code>
- <code title="get /api/{account}/media/vault/lists/{list_id}">client.media.vault.lists.<a href="./src/onlyfansapi/resources/media/vault/lists/lists.py">retrieve</a>(list_id, \*, account) -> <a href="./src/onlyfansapi/types/media/vault/list_retrieve_response.py">ListRetrieveResponse</a></code>
- <code title="put /api/{account}/media/vault/lists/{list_id}">client.media.vault.lists.<a href="./src/onlyfansapi/resources/media/vault/lists/lists.py">update</a>(list_id, \*, account) -> <a href="./src/onlyfansapi/types/media/vault/list_update_response.py">ListUpdateResponse</a></code>
- <code title="put /api/{account}/media/vault/lists/{list_id}">client.media.vault.lists.<a href="./src/onlyfansapi/resources/media/vault/lists/lists.py">update</a>(list_id, \*, account, \*\*<a href="src/onlyfansapi/types/media/vault/list_update_params.py">params</a>) -> <a href="./src/onlyfansapi/types/media/vault/list_update_response.py">ListUpdateResponse</a></code>
- <code title="get /api/{account}/media/vault/lists">client.media.vault.lists.<a href="./src/onlyfansapi/resources/media/vault/lists/lists.py">list</a>(account, \*\*<a href="src/onlyfansapi/types/media/vault/list_list_params.py">params</a>) -> <a href="./src/onlyfansapi/types/media/vault/list_list_response.py">ListListResponse</a></code>
- <code title="delete /api/{account}/media/vault/lists/{list_id}">client.media.vault.lists.<a href="./src/onlyfansapi/resources/media/vault/lists/lists.py">delete</a>(list_id, \*, account) -> <a href="./src/onlyfansapi/types/media/vault/list_delete_response.py">ListDeleteResponse</a></code>

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "onlyfans"
version = "0.1.2"
version = "0.2.0"
description = "The official Python library for the OnlyFansAPI API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
12 changes: 6 additions & 6 deletions src/onlyfansapi/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def giphy(self) -> GiphyResource:

@cached_property
def link_tags(self) -> LinkTagsResource:
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""
from .resources.link_tags import LinkTagsResource

return LinkTagsResource(self)
Expand Down Expand Up @@ -779,7 +779,7 @@ def giphy(self) -> AsyncGiphyResource:

@cached_property
def link_tags(self) -> AsyncLinkTagsResource:
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""
from .resources.link_tags import AsyncLinkTagsResource

return AsyncLinkTagsResource(self)
Expand Down Expand Up @@ -1189,7 +1189,7 @@ def giphy(self) -> giphy.GiphyResourceWithRawResponse:

@cached_property
def link_tags(self) -> link_tags.LinkTagsResourceWithRawResponse:
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""
from .resources.link_tags import LinkTagsResourceWithRawResponse

return LinkTagsResourceWithRawResponse(self._client.link_tags)
Expand Down Expand Up @@ -1482,7 +1482,7 @@ def giphy(self) -> giphy.AsyncGiphyResourceWithRawResponse:

@cached_property
def link_tags(self) -> link_tags.AsyncLinkTagsResourceWithRawResponse:
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""
from .resources.link_tags import AsyncLinkTagsResourceWithRawResponse

return AsyncLinkTagsResourceWithRawResponse(self._client.link_tags)
Expand Down Expand Up @@ -1775,7 +1775,7 @@ def giphy(self) -> giphy.GiphyResourceWithStreamingResponse:

@cached_property
def link_tags(self) -> link_tags.LinkTagsResourceWithStreamingResponse:
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""
from .resources.link_tags import LinkTagsResourceWithStreamingResponse

return LinkTagsResourceWithStreamingResponse(self._client.link_tags)
Expand Down Expand Up @@ -2068,7 +2068,7 @@ def giphy(self) -> giphy.AsyncGiphyResourceWithStreamingResponse:

@cached_property
def link_tags(self) -> link_tags.AsyncLinkTagsResourceWithStreamingResponse:
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""
from .resources.link_tags import AsyncLinkTagsResourceWithStreamingResponse

return AsyncLinkTagsResourceWithStreamingResponse(self._client.link_tags)
Expand Down
2 changes: 1 addition & 1 deletion src/onlyfansapi/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "onlyfansapi"
__version__ = "0.1.2" # x-release-please-version
__version__ = "0.2.0" # x-release-please-version
20 changes: 10 additions & 10 deletions src/onlyfansapi/resources/link_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


class LinkTagsResource(SyncAPIResource):
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""

@cached_property
def with_raw_response(self) -> LinkTagsResourceWithRawResponse:
Expand All @@ -48,7 +48,7 @@ def with_streaming_response(self) -> LinkTagsResourceWithStreamingResponse:
def list(
self,
*,
type: Literal["trial_links", "tracking_links"] | Omit = omit,
type: Literal["trial_links", "tracking_links", "smart_links"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -57,11 +57,11 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> LinkTagListResponse:
"""
Get all existing tags that have been used on free trial links and/or tracking
links for this account. This is a free endpoint.
Get all existing tags that have been used on free trial links, tracking links,
and/or Smart Links for this account. This is a free endpoint.

Args:
type: Filter by link type. If not provided, returns tags for both types.
type: Filter by link type. If not provided, returns tags for all types.

extra_headers: Send extra headers

Expand All @@ -85,7 +85,7 @@ def list(


class AsyncLinkTagsResource(AsyncAPIResource):
"""APIs for managing tags on free trial links and tracking links"""
"""APIs for managing tags on free trial links, tracking links, and Smart Links"""

@cached_property
def with_raw_response(self) -> AsyncLinkTagsResourceWithRawResponse:
Expand All @@ -109,7 +109,7 @@ def with_streaming_response(self) -> AsyncLinkTagsResourceWithStreamingResponse:
async def list(
self,
*,
type: Literal["trial_links", "tracking_links"] | Omit = omit,
type: Literal["trial_links", "tracking_links", "smart_links"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -118,11 +118,11 @@ async def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> LinkTagListResponse:
"""
Get all existing tags that have been used on free trial links and/or tracking
links for this account. This is a free endpoint.
Get all existing tags that have been used on free trial links, tracking links,
and/or Smart Links for this account. This is a free endpoint.

Args:
type: Filter by link type. If not provided, returns tags for both types.
type: Filter by link type. If not provided, returns tags for all types.

extra_headers: Send extra headers

Expand Down
24 changes: 13 additions & 11 deletions src/onlyfansapi/resources/media/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
AsyncUploadsResourceWithStreamingResponse,
)
from ..._files import deepcopy_with_paths
from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, omit, not_given
from ..._utils import extract_files, path_template, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -81,14 +81,15 @@ def download(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
) -> None:
"""Downloads a file directly from a `https://cdn*.onlyfans.com/*` URL.

When the
file is already cached on our CDN, this endpoint returns a `302` redirect to a
`https://cdn.fansapi.com/*` URL. Most HTTP clients follow redirects
automatically (`curl` requires `-L`). Otherwise, the file is streamed through
our proxies and queued for caching.
automatically (`curl` requires `-L`). Otherwise, the file is redirected to
`dl.fansapi.com`, which streams it through the account proxy and reports billing
back to the API.

Args:
extra_headers: Send extra headers
Expand All @@ -103,13 +104,13 @@ def download(
raise ValueError(f"Expected a non-empty value for `account` but received {account!r}")
if not cdn_url:
raise ValueError(f"Expected a non-empty value for `cdn_url` but received {cdn_url!r}")
extra_headers = {"Accept": "text/plain", **(extra_headers or {})}
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._get(
path_template("/api/{account}/media/download/{cdn_url}", account=account, cdn_url=cdn_url),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=str,
cast_to=NoneType,
)

def scrape(
Expand Down Expand Up @@ -285,14 +286,15 @@ async def download(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> str:
) -> None:
"""Downloads a file directly from a `https://cdn*.onlyfans.com/*` URL.

When the
file is already cached on our CDN, this endpoint returns a `302` redirect to a
`https://cdn.fansapi.com/*` URL. Most HTTP clients follow redirects
automatically (`curl` requires `-L`). Otherwise, the file is streamed through
our proxies and queued for caching.
automatically (`curl` requires `-L`). Otherwise, the file is redirected to
`dl.fansapi.com`, which streams it through the account proxy and reports billing
back to the API.

Args:
extra_headers: Send extra headers
Expand All @@ -307,13 +309,13 @@ async def download(
raise ValueError(f"Expected a non-empty value for `account` but received {account!r}")
if not cdn_url:
raise ValueError(f"Expected a non-empty value for `cdn_url` but received {cdn_url!r}")
extra_headers = {"Accept": "text/plain", **(extra_headers or {})}
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._get(
path_template("/api/{account}/media/download/{cdn_url}", account=account, cdn_url=cdn_url),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=str,
cast_to=NoneType,
)

async def scrape(
Expand Down
Loading
Loading