Skip to content

Commit

Permalink
Update kemono-dl.py
Browse files Browse the repository at this point in the history
when getting username remove trailing whitespaces.
  • Loading branch information
AlphaSlayer1964 authored Sep 27, 2021
1 parent 5a8a0b4 commit 6a1ca33
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kemono-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
import time

version = '2021.09.26.1'
version = '2021.09.27'

ap = argparse.ArgumentParser()
ap.add_argument("--Version", action='store_true', help="prints version")
Expand Down Expand Up @@ -35,7 +35,8 @@
print('Invalid Download Location:' + DL)
quit()
Download_Location = DL


# re work this in the future
def Download_Status(dl_status):
if dl_status[0] == 0: # download completed
return True
Expand Down Expand Up @@ -199,7 +200,7 @@ def Download_Post(link, username, service):
service = 'pixiv fanbox'
page_html = requests.get(user_post.group(1), allow_redirects=True, cookies=jar)
page_soup = BeautifulSoup(page_html.text, 'html.parser')
username = page_soup.find("span", {"itemprop": "name"}).text
username = page_soup.find("span", {"itemprop": "name"}).text.strip()
Download_Post(user.strip(), username, service)

user_profile = re.search('https://kemono\.party/([^/]+)/user/[^/]+$', user.strip())
Expand All @@ -210,7 +211,7 @@ def Download_Post(link, username, service):
service = 'pixiv fanbox'
page_html = requests.get(user.strip(), allow_redirects=True, cookies=jar)
page_soup = BeautifulSoup(page_html.text, 'html.parser')
username = page_soup.find("span", {"itemprop": "name"}).text
username = page_soup.find("span", {"itemprop": "name"}).text.strip()
posts = page_soup.find_all("article")
for post in posts:
post_links.append("https://kemono.party" + post.find('a')["href"])
Expand Down

0 comments on commit 6a1ca33

Please sign in to comment.