mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
py3: Port use of urlparse in recipes
This commit is contained in:
parent
40491089f1
commit
c32b7daafa
@ -6,6 +6,9 @@ Hacker News
|
||||
'''
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
try:
|
||||
from urllib.parse import urlparse
|
||||
except ImportError:
|
||||
from urlparse import urlparse
|
||||
import re
|
||||
|
||||
|
@ -3,14 +3,15 @@ __copyright__ = "2008, Derry FitzGerald. 2009 Modified by Ray Kinsella and David
|
||||
'''
|
||||
irishtimes.com
|
||||
'''
|
||||
import urlparse, re
|
||||
import re
|
||||
import json
|
||||
from uuid import uuid4
|
||||
from mechanize import Request
|
||||
try:
|
||||
from urllib.parse import urlencode
|
||||
from urllib.parse import urlencode, urljoin
|
||||
except ImportError:
|
||||
from urllib import urlencode
|
||||
from urlparse import urljoin
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
@ -87,7 +88,7 @@ class IrishTimes(BasicNewsRecipe):
|
||||
pic = div.img
|
||||
if pic:
|
||||
try:
|
||||
pic['src'] = urlparse.urljoin(url, pic['src'])
|
||||
pic['src'] = urljoin(url, pic['src'])
|
||||
pic.extract()
|
||||
except:
|
||||
pic = None
|
||||
|
@ -9,6 +9,9 @@ try:
|
||||
from urllib.parse import urlencode
|
||||
except ImportError:
|
||||
from urllib import urlencode
|
||||
try:
|
||||
from urllib.parse import urlparse, urlunparse, parse_qs
|
||||
except ImportError:
|
||||
from urlparse import urlparse, urlunparse, parse_qs
|
||||
from calibre import strftime
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
@ -3,9 +3,12 @@ from __future__ import print_function
|
||||
# .epub --test -vv --debug-pipeline debug
|
||||
import re
|
||||
import time
|
||||
from urlparse import urlparse
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
from calibre.ebooks.BeautifulSoup import NavigableString
|
||||
try:
|
||||
from urllib.parse import urlparse
|
||||
except ImportError:
|
||||
from urlparse import urlparse
|
||||
|
||||
|
||||
class RealClear(BasicNewsRecipe):
|
||||
|
@ -7,9 +7,13 @@ __copyright__ = '2014, spswerling'
|
||||
www.todayszaman.com
|
||||
'''
|
||||
import re
|
||||
from urlparse import urljoin
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
try:
|
||||
from urllib.parse import urljoin
|
||||
except ImportError:
|
||||
from urlparse import urljoin
|
||||
|
||||
|
||||
class TodaysZaman(BasicNewsRecipe):
|
||||
|
||||
|
@ -17,6 +17,9 @@ import io
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre import walk
|
||||
try:
|
||||
from urllib.parse import urlparse
|
||||
except ImportError:
|
||||
from urlparse import urlparse
|
||||
from contextlib import closing
|
||||
from calibre.utils.magick.draw import save_cover_data_to
|
||||
|
Loading…
x
Reference in New Issue
Block a user