Skip to content

Commit

Permalink
feat: slugify stickers title to ensure validity
Browse files Browse the repository at this point in the history
  • Loading branch information
sylux6 committed May 26, 2024
1 parent a16bf51 commit 8cd2f5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import requests
import shutil

from slugify import slugify


def download_image(download_path: str, url: str, file_name: str):
res = requests.get(url, stream=True)
Expand Down Expand Up @@ -39,7 +41,7 @@ def gif_conversion(file_name: str, output_file: str):

page = requests.get(args.url)
soup = BeautifulSoup(page.content, "html.parser")
title = "pingu" if args.is_github else soup.find("p", class_="mdCMN38Item01Ttl").text
title = "pingu" if args.is_github else slugify(soup.find("p", class_="mdCMN38Item01Ttl").text)
stickers = soup.find_all("li", class_="mdCMN09Li")

if len(stickers):
Expand Down
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 8cd2f5f

Please sign in to comment.