Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Jan 10, 2024
1 parent 7f4c768 commit dbfdfac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ofscraper/api/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ async def scrape_labels(c, model_id, job_progress, offset=0):
)
)
)
job_progress.remove_task(task)
return data.get("list")

else:
Expand All @@ -163,6 +162,7 @@ async def scrape_labels(c, model_id, job_progress, offset=0):
except Exception as E:
log.traceback_(E)
log.traceback_(traceback.format_exc())
raise E

finally:
sem.release()
Expand Down
2 changes: 1 addition & 1 deletion ofscraper/classes/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def license(self):
if not self.mpd:
return None
responsetype = self.post.post["responseType"]
if responsetype in ["timeline", "archived", "pinned"]:
if responsetype in ["timeline", "archived", "pinned", "posts"]:
responsetype = "post"
return constants.getattr("LICENCE_URL").format(
self.id, responsetype, self.postid
Expand Down
6 changes: 4 additions & 2 deletions ofscraper/classes/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ def modified_responsetype(self):

else:
# remap some values
response = (
config.read_config().get("responsetype", {}).get(self.responsetype)
response_key = self.responsetype
response_key = (
"Timeline" if response_key.lower() in {"post", "post"} else response_key
)
response = config.read_config().get("responsetype", {}).get(response_key)

if response == "":
return self.responsetype.capitalize()
Expand Down
2 changes: 1 addition & 1 deletion ofscraper/commands/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_media_from_urls(urls):
elif type == "msg2":
model_id = user_name_dict.get(model) or profile.get_id(model)
data = messages_.get_individual_post(model_id, postid, c=c) or {}
if (data).get("id") != postid:
if (data).get("id") != int(postid):
data = paid.get_individual_post(model, model_id, postid) or {}
id_dict[model_id] = id_dict.get(model_id, []) + [data]
elif type == "unknown":
Expand Down
2 changes: 1 addition & 1 deletion ofscraper/download/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def medialist_filter(medialist, model_id, username):
log.debug(f"Final Number of media to download {len(medialist)}")

else:
log.info(f"forcing all downloads media count {lense(medialist)}")
log.info(f"forcing all downloads media count {len(medialist)}")
return medialist


Expand Down

0 comments on commit dbfdfac

Please sign in to comment.