Skip to content

Commit

Permalink
OnlyFans
Browse files Browse the repository at this point in the history
Checking if sess token valid
Checking if head request is valid
  • Loading branch information
SecretShell committed Jan 28, 2020
1 parent 454773d commit ba4421a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,7 @@ def json_request(session, link, type="GET"):
return r
except ConnectionResetError:
count += 1

def update_config(json_config):
with open('config.json', 'w', encoding='utf-8') as f:
json.dump(json_config, f, ensure_ascii=False, indent=2)
4 changes: 3 additions & 1 deletion modules/onlyfans.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ def download_media(media_set, session, directory, username, post_count, location
def download(media, session, directory, username):
while True:
link = media["link"]
r = session.head(link)
r = json_request(session, link, "HEAD")
if not r:
break

header = r.headers
content_length = int(header["content-length"])
Expand Down

0 comments on commit ba4421a

Please sign in to comment.