-import urllib
-import BeautifulSoup
-import lib, htcache
-soup = BeautifulSoup.BeautifulSoup
-
-class imgstream(lib.imgstream):
- def __init__(self, url):
- self.bk = urllib.urlopen(url)
- self.ctype = self.bk.info()["Content-Type"]
-
- def fileno(self):
- return self.bk.fileno()
-
- def close(self):
- self.bk.close()
-
- def read(self, sz = None):
- if sz is None:
- return self.bk.read()
- else:
- return self.bk.read(sz)
+import urllib.request, re
+import bs4, json
+from . import lib, htcache
+soup = bs4.BeautifulSoup
+soupify = lambda cont: soup(cont)