Skip to content

Commit

Permalink
Feature and a fix
Browse files Browse the repository at this point in the history
[CONFIG]
Added infinite_loop to config.
If you want to run the script once, set it to false.

[ONLYFANS]
Fixed messages not getting the correct file size
  • Loading branch information
SecretShell committed Dec 7, 2019
1 parent 2d3d455 commit 283b5ae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ multithreading:
If set to false, you will download files 1 by 1. (If you don't have fast internet, may god help you.)
I'd reccomend leaving it set to true.

infinite_loop:

Default = true

If set to false, the script will run once and ask you to input anything to continue.

boards:

Default = []
Expand Down
4 changes: 4 additions & 0 deletions StartDatascraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
json_config = json.load(open('config.json'))
json_sites = json_config["supported"]
json_settings = json_config["settings"]
infinite_loop = json_settings['infinite_loop']
user_agent = json_settings['user-agent']
domain = json_settings["auto_site_choice"]

Expand Down Expand Up @@ -111,6 +112,9 @@
x.download_media(*arg)
stop_time = str(int(timeit.default_timer() - start_time) / 60)
print('Task Completed in ' + stop_time + ' Minutes')
if not infinite_loop:
print("Input anything to continue")
input()
except Exception as e:
tb = traceback.format_exc()
print(tb+"\n")
Expand Down
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"auto_site_choice": "",
"export_type": "json",
"multithreading": true,
"infinite_loop": true,
"user-agent": ""
},
"supported": {
Expand Down
4 changes: 2 additions & 2 deletions modules/onlyfans.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def scrape_choice(user_id, app_token, post_counts):
post_api, x, *mandatory, post_count], "Posts"]
m_array = ["You have chosen to scrape {}", [
message_api, x, *mandatory, post_count], "Messages"]
array = [s_array,p_array,m_array]
array = [s_array, p_array, m_array]
valid_input = False
if input_choice == "a":
valid_input = True
Expand Down Expand Up @@ -203,7 +203,7 @@ def scrape_array(link, session, directory, username, api_type):
date = media_api["postedAt"] if "postedAt" in media_api else media_api["createdAt"]
if "src" in media:
link = media["src"]
size = media["info"]["preview"]["size"]
size = media["info"]["preview"]["size"] if "info" in media_api else 1
date = media_api["createdAt"]
if not link:
continue
Expand Down

0 comments on commit 283b5ae

Please sign in to comment.