]> jfr.im git - erebus.git/commitdiff
urls - fix basic title functionality
authorJohn Runyon <redacted>
Tue, 20 Jun 2023 21:29:43 +0000 (15:29 -0600)
committerJohn Runyon <redacted>
Tue, 20 Jun 2023 21:29:43 +0000 (15:29 -0600)
modules/urls.py

index 93615911226ffc94c7cd09712603497941d43806..9ac8629fbbf3db90b39c55af769abb448805e18d 100644 (file)
@@ -26,17 +26,16 @@ if sys.version_info.major < 3:
        import urllib2
        import urlparse
        import HTMLParser
+       html = HTMLParser.HTMLParser()
        from BeautifulSoup import BeautifulSoup
 else:
        import urllib.request as urllib2
        import urllib.parse as urlparse
-       import html.parser as HTMLParser
+       import html
        from bs4 import BeautifulSoup
 
 import re, json, datetime
 
-html_parser = HTMLParser.HTMLParser()
-
 hostmask_regex = re.compile(r'^(.*)!(.*)@(.*)$')
 
 def parser_hostmask(hostmask):
@@ -111,7 +110,7 @@ def privmsg_hook(bot, textline):
                        bot.msg(chan, ' | '.join(responses), True)
 
 def unescape(line):
-       return re.sub('\s+', ' ', html_parser.unescape(line))
+       return re.sub('\s+', ' ', html.unescape(line))
 
 def gotspotify(type, track):
        url = 'http://ws.spotify.com/lookup/1/?uri=spotify:%s:%s' % (type, track)