onlyfans-scraper


Nameonlyfans-scraper JSON
Version 1.4.0 PyPI version JSON
download
home_pagehttps://github.com/Amenly/onlyfans-scraper
SummaryA command-line program to download media, like posts, and more from creators on OnlyFans.
upload_time2021-05-05 19:04:22
maintainer
docs_urlNone
authorAmenly
requires_python>=3.8
licenseGNU General Public License v3 or later (GPLv3+)
keywords onlyfans download photos videos like
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/icon.png" width="100" align="right">

# onlyfans-scraper

![version](https://img.shields.io/pypi/v/onlyfans-scraper) ![python3.8-3.9](https://img.shields.io/pypi/pyversions/onlyfans-scraper) ![downloads](https://img.shields.io/pypi/dm/onlyfans-scraper) ![status](https://img.shields.io/badge/status-up-success)

A command-line program to download media, like and unlike posts, and more from creators on OnlyFans.

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/example.png" width="550">

## Installation

You can install this program by entering the following in your terminal:

```
pip install onlyfans-scraper
```

If you're on macOS/Linux, then do this instead:

```
pip3 install onlyfans-scraper
```

## Setup

Before you can fully use it, you need to fill out some fields in a `auth.json` file. This file will be created for you when you run the program for the first time.

These are the fields:

```json
{
    "auth": {
        "app-token": "33d57ade8c02dbc5a333db99ff9ae26a",
        "sess": "",
        "auth_id": "",
        "auth_uniq_": "",
        "user_agent": "",
        "x-bc": ""
    }
}
```

It's really not that bad. I'll show you in the next sections how to get these bits of info.


### Step One: Creating the 'auth.json' File

You first need to run the program in order for the `auth.json` file to be created. To run it, simply type `onlyfans-scraper` in your terminal and hit enter. Because you don't have an `auth.json` file, the program will create one for you and then ask you to enter some information. Now we need to get that information.


### Step Two: Getting Your Auth Info

***If you've already used DIGITALCRIMINAL's OnlyFans script, you can simply copy and paste the auth information from there to here.***

Go to your [notification area](https://onlyfans.com/my/notifications) on OnlyFans. Once you're there, open your browser's developer tools. If you don't know how to do that, consult the following chart:

| Operating System | Keys |
| :----------------: | :----: |
| macOS | <kbd>alt</kbd><kbd>cmd</kbd><kbd>i</kbd> |
| Windows | <kbd>ctrl</kbd><kbd>shift</kbd><kbd>i</kbd> |
| Linux | <kbd>ctrl</kbd><kbd>shift</kbd><kbd>i</kbd> |

Once you have your browser's developer tools open, your screen should look like the following:

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/browser_tools_open.png">

Click on the `Network` tab at the top of the browser tools:

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/network_tab.png">

Then click on `XHR` sub-tab inside of the `Network` tab:

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/xhr_tab.png">

Once you're inside of the `XHR` sub-tab, refresh the page while you have your browser's developer tools open. After the page reloads, you should see a section titled `init` appear:

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/init.png">

When you click on `init`, you should see a large sidebar appear. Make sure you're in the `Headers` section:

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/headers.png">

After that, scroll down until you see a subsection called `Request Headers`. You should then see three important fields inside of the `Request Headers` subsection: `Cookie`, `User-Agent`, and `x-bc`

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/request_headers.png">

Inside of the `Cookie` field, you will see a couple of important bits:

* `sess=`
* `auth_id=`
* `auth_uid_=`

*Your* `auth_uid_` *will *only* appear **if you have 2FA (two-factor authentication) enabled**. Also, keep in mind that your* `auth_uid_` *will have numbers after the final underscore and before the equal sign (that's your auth_id).*

You need everything ***after*** the equal sign and everything ***before*** the semi-colon for all of those bits. 

Once you've copied the value for your `sess` cookie, go back to the program, paste it in, and hit enter. Now go back to your browser, copy the `auth_id` value, and paste it into the program and hit enter. Then go back to your browser, copy the `auth_uid_` value, and paste it into the program and hit enter (**leave this blank if you don't use 2FA!!!**).

Once you do that, the program will ask for your user agent. You should be able to find your user agent in a field called `User-Agent` below the `Cookie` field. Copy it and paste it into the program and hit enter.

After it asks for your user agent, it will ask for your `x-bc` token. You should also be able to find this in the `Request Headers` section.

You're all set and you can now use `onlyfans-scraper`.


## Usage

Whenever you want to run the program, all you need to do is type `onlyfans-scraper` in your terminal:

```
onlyfans-scraper
```

That's it. It's that simple.

 Once the program launches, all you need to do is follow the on-screen directions. The first time you run it, it will ask you to fill out your `auth.json` file (directions for that in the section above). 

You will need to use your arrow keys to select an option:

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/main_menu.png" width="450">

If you choose to download content, you will have three options: having a list of all of your subscriptions printed, manually entering a username, or scraping *all* accounts that you're subscribed to.

<img src="https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/list_or_username.png" width="550">

### Liking/Unliking Posts

You can also use this program to like all of a user's posts or remove your likes from their posts. Just select either option during the main menu screen and enter their username.

This program will like posts at a rate of around one post per second. This may be reduced in the future but OnlyFans is strict about how quickly you can like posts.

### Migrating Databases

If you've used DIGITALCRIMINAL's script, you might've liked how his script prevented duplicates from being downloaded each time you ran it on a user. This is done through database files.

This program also uses a database file to prevent duplicates. In order to make it easier for user's to transition from his program to this one, this program will migrate the data from those databases for you (***only IDs and filenames***). 

In order to use it select the last option (Migrate an old database) and enter the *path* to the directory that contains the database files (*Posts.db, Archived.db, etc.*). 

For example, if you have a directory that looks like the following:

```
Users
|__ home
    |__ .sites
        |__ OnlyFans
            |__ melodyjai
                |__ Metadata
                    |__ Archived.db
                    |__ Messages.db
                    |__ Posts.db
```

Then the path you enter should be `/Users/home/.sites/OnlyFans/melodyjai/Metadata`. The program will detect the .db files in the directory and then ask you for the username to whom those .db files belong. The program will then move the relevant data over.

## Bugs/Issues/Suggestions

If you run into any trouble while using this script, or if you're confused on how to get something running, feel free to [open an issue](https://github.com/Amenly/onlyfans-scraper/issues/new) or [open a discussion](https://github.com/Amenly/onlyfans-scraper/discussions/new). I don't bite :D

If you would like a feature added to the program or have some ideas, [start a discussion](https://github.com/Amenly/onlyfans-scraper/discussions/new)!



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Amenly/onlyfans-scraper",
    "name": "onlyfans-scraper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "onlyfans,download,photos,videos,like",
    "author": "Amenly",
    "author_email": "uamenly@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/27/d7aab0b7f02a676d5980ae544b7ca626aea7241b590316d248abffdd2dd6/onlyfans-scraper-1.4.0.tar.gz",
    "platform": "",
    "description": "<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/icon.png\" width=\"100\" align=\"right\">\n\n# onlyfans-scraper\n\n![version](https://img.shields.io/pypi/v/onlyfans-scraper) ![python3.8-3.9](https://img.shields.io/pypi/pyversions/onlyfans-scraper) ![downloads](https://img.shields.io/pypi/dm/onlyfans-scraper) ![status](https://img.shields.io/badge/status-up-success)\n\nA command-line program to download media, like and unlike posts, and more from creators on OnlyFans.\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/example.png\" width=\"550\">\n\n## Installation\n\nYou can install this program by entering the following in your terminal:\n\n```\npip install onlyfans-scraper\n```\n\nIf you're on macOS/Linux, then do this instead:\n\n```\npip3 install onlyfans-scraper\n```\n\n## Setup\n\nBefore you can fully use it, you need to fill out some fields in a `auth.json` file. This file will be created for you when you run the program for the first time.\n\nThese are the fields:\n\n```json\n{\n    \"auth\": {\n        \"app-token\": \"33d57ade8c02dbc5a333db99ff9ae26a\",\n        \"sess\": \"\",\n        \"auth_id\": \"\",\n        \"auth_uniq_\": \"\",\n        \"user_agent\": \"\",\n        \"x-bc\": \"\"\n    }\n}\n```\n\nIt's really not that bad. I'll show you in the next sections how to get these bits of info.\n\n\n### Step One: Creating the 'auth.json' File\n\nYou first need to run the program in order for the `auth.json` file to be created. To run it, simply type `onlyfans-scraper` in your terminal and hit enter. Because you don't have an `auth.json` file, the program will create one for you and then ask you to enter some information. Now we need to get that information.\n\n\n### Step Two: Getting Your Auth Info\n\n***If you've already used DIGITALCRIMINAL's OnlyFans script, you can simply copy and paste the auth information from there to here.***\n\nGo to your [notification area](https://onlyfans.com/my/notifications) on OnlyFans. Once you're there, open your browser's developer tools. If you don't know how to do that, consult the following chart:\n\n| Operating System | Keys |\n| :----------------: | :----: |\n| macOS | <kbd>alt</kbd><kbd>cmd</kbd><kbd>i</kbd> |\n| Windows | <kbd>ctrl</kbd><kbd>shift</kbd><kbd>i</kbd> |\n| Linux | <kbd>ctrl</kbd><kbd>shift</kbd><kbd>i</kbd> |\n\nOnce you have your browser's developer tools open, your screen should look like the following:\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/browser_tools_open.png\">\n\nClick on the `Network` tab at the top of the browser tools:\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/network_tab.png\">\n\nThen click on `XHR` sub-tab inside of the `Network` tab:\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/xhr_tab.png\">\n\nOnce you're inside of the `XHR` sub-tab, refresh the page while you have your browser's developer tools open. After the page reloads, you should see a section titled `init` appear:\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/init.png\">\n\nWhen you click on `init`, you should see a large sidebar appear. Make sure you're in the `Headers` section:\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/headers.png\">\n\nAfter that, scroll down until you see a subsection called `Request Headers`. You should then see three important fields inside of the `Request Headers` subsection: `Cookie`, `User-Agent`, and `x-bc`\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/request_headers.png\">\n\nInside of the `Cookie` field, you will see a couple of important bits:\n\n* `sess=`\n* `auth_id=`\n* `auth_uid_=`\n\n*Your* `auth_uid_` *will *only* appear **if you have 2FA (two-factor authentication) enabled**. Also, keep in mind that your* `auth_uid_` *will have numbers after the final underscore and before the equal sign (that's your auth_id).*\n\nYou need everything ***after*** the equal sign and everything ***before*** the semi-colon for all of those bits. \n\nOnce you've copied the value for your `sess` cookie, go back to the program, paste it in, and hit enter. Now go back to your browser, copy the `auth_id` value, and paste it into the program and hit enter. Then go back to your browser, copy the `auth_uid_` value, and paste it into the program and hit enter (**leave this blank if you don't use 2FA!!!**).\n\nOnce you do that, the program will ask for your user agent. You should be able to find your user agent in a field called `User-Agent` below the `Cookie` field. Copy it and paste it into the program and hit enter.\n\nAfter it asks for your user agent, it will ask for your `x-bc` token. You should also be able to find this in the `Request Headers` section.\n\nYou're all set and you can now use `onlyfans-scraper`.\n\n\n## Usage\n\nWhenever you want to run the program, all you need to do is type `onlyfans-scraper` in your terminal:\n\n```\nonlyfans-scraper\n```\n\nThat's it. It's that simple.\n\n Once the program launches, all you need to do is follow the on-screen directions. The first time you run it, it will ask you to fill out your `auth.json` file (directions for that in the section above). \n\nYou will need to use your arrow keys to select an option:\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/main_menu.png\" width=\"450\">\n\nIf you choose to download content, you will have three options: having a list of all of your subscriptions printed, manually entering a username, or scraping *all* accounts that you're subscribed to.\n\n<img src=\"https://raw.githubusercontent.com/Amenly/onlyfans-scraper/main/media/list_or_username.png\" width=\"550\">\n\n### Liking/Unliking Posts\n\nYou can also use this program to like all of a user's posts or remove your likes from their posts. Just select either option during the main menu screen and enter their username.\n\nThis program will like posts at a rate of around one post per second. This may be reduced in the future but OnlyFans is strict about how quickly you can like posts.\n\n### Migrating Databases\n\nIf you've used DIGITALCRIMINAL's script, you might've liked how his script prevented duplicates from being downloaded each time you ran it on a user. This is done through database files.\n\nThis program also uses a database file to prevent duplicates. In order to make it easier for user's to transition from his program to this one, this program will migrate the data from those databases for you (***only IDs and filenames***). \n\nIn order to use it select the last option (Migrate an old database) and enter the *path* to the directory that contains the database files (*Posts.db, Archived.db, etc.*). \n\nFor example, if you have a directory that looks like the following:\n\n```\nUsers\n|__ home\n    |__ .sites\n        |__ OnlyFans\n            |__ melodyjai\n                |__ Metadata\n                    |__ Archived.db\n                    |__ Messages.db\n                    |__ Posts.db\n```\n\nThen the path you enter should be `/Users/home/.sites/OnlyFans/melodyjai/Metadata`. The program will detect the .db files in the directory and then ask you for the username to whom those .db files belong. The program will then move the relevant data over.\n\n## Bugs/Issues/Suggestions\n\nIf you run into any trouble while using this script, or if you're confused on how to get something running, feel free to [open an issue](https://github.com/Amenly/onlyfans-scraper/issues/new) or [open a discussion](https://github.com/Amenly/onlyfans-scraper/discussions/new). I don't bite :D\n\nIf you would like a feature added to the program or have some ideas, [start a discussion](https://github.com/Amenly/onlyfans-scraper/discussions/new)!\n\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 or later (GPLv3+)",
    "summary": "A command-line program to download media, like posts, and more from creators on OnlyFans.",
    "version": "1.4.0",
    "split_keywords": [
        "onlyfans",
        "download",
        "photos",
        "videos",
        "like"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "ad3874f5788364b7e6618d1ca3248ca4",
                "sha256": "2ad95b18342502e449495aa97bdb0b0744b6bf32c4f900584b12a78445132a99"
            },
            "downloads": -1,
            "filename": "onlyfans_scraper-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ad3874f5788364b7e6618d1ca3248ca4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 38630,
            "upload_time": "2021-05-05T19:04:20",
            "upload_time_iso_8601": "2021-05-05T19:04:20.818782Z",
            "url": "https://files.pythonhosted.org/packages/9f/f7/0796cb1b236d1bc4b48a5cd72241238edb0476048970ce723f1a4043448c/onlyfans_scraper-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "ee89b20dfd40177f9b6b93e3c39ae1fd",
                "sha256": "27438aaff874a4eb4f67925a2ef8b12635ab1225ee13490fd905f9e87171000b"
            },
            "downloads": -1,
            "filename": "onlyfans-scraper-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ee89b20dfd40177f9b6b93e3c39ae1fd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20453,
            "upload_time": "2021-05-05T19:04:22",
            "upload_time_iso_8601": "2021-05-05T19:04:22.221422Z",
            "url": "https://files.pythonhosted.org/packages/0b/27/d7aab0b7f02a676d5980ae544b7ca626aea7241b590316d248abffdd2dd6/onlyfans-scraper-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-05-05 19:04:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "Amenly",
    "error": "Could not fetch GitHub repository",
    "lcname": "onlyfans-scraper"
}
        
Elapsed time: 0.23388s