Skip to content

Commit

Permalink
Decode fix
Browse files Browse the repository at this point in the history
  • Loading branch information
madprops committed Feb 2, 2024
1 parent f4217e2 commit e0bff52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clipton.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

VERSION = "40"
VERSION = "41"
# https://github.com/madprops/clipton

import os
Expand Down Expand Up @@ -268,7 +268,11 @@ def get_title(text: str) -> str:

if (http or https) and not Utils.space(text):
if Utils.get_url_type(text) == "text/html":
html = str(urlopen(text).read().decode("utf-8"))
try:
html = str(urlopen(text).read().decode("utf-8"))
except:
return ""

parser = Utils.TitleParser()
parser.feed(html)
return parser.title
Expand Down

0 comments on commit e0bff52

Please sign in to comment.