Skip to content

Commit

Permalink
fix bug with add_slash
Browse files Browse the repository at this point in the history
  • Loading branch information
jpontoire committed Jan 15, 2025
1 parent 8dc345c commit de29187
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions minet/reddit/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
# when missing a '/' at the end of an url, reddit will make a redirection and it will reduce by 2 the number of requests remaining
def add_slash(url: str):
path = url.split("/")
if path[-1][0] == "?":
return url
elif url[-1] != "/":
if path[-1] != "" and not path[-1].startswith("?"):
return url + "/"
return url

Expand Down

0 comments on commit de29187

Please sign in to comment.