add r in front of regexps

This commit is contained in:
Christophe Benz 2010-07-14 02:28:33 +02:00 committed by Romain Bignon
commit 8e37f7227e
2 changed files with 8 additions and 7 deletions

View file

@ -32,10 +32,11 @@ __all__ = ['YoupornBrowser']
class YoupornBrowser(BaseBrowser):
DOMAIN = 'youporn.com'
PAGES = {'http://[w\.]*youporn\.com/?': IndexPage,
'http://[w\.]*youporn\.com/search.*': IndexPage,
'http://[w\.]*youporn\.com/watch/(?P<id>.+)': VideoPage,
'http://[w\.]*youporngay\.com:80/watch/(?P<id>.+)': VideoPage,
ENCODING = None
PAGES = {r'http://[w\.]*youporn\.com/?': IndexPage,
r'http://[w\.]*youporn\.com/search.*': IndexPage,
r'http://[w\.]*youporn\.com/watch/(?P<id>.+)': VideoPage,
r'http://[w\.]*youporngay\.com:80/watch/(?P<id>.+)': VideoPage,
}
@id2url(YoupornVideo.id2url)

View file

@ -28,9 +28,9 @@ __all__ = ['YoutubeBrowser']
class YoutubeBrowser(BaseBrowser):
DOMAIN = u'youtube.com'
PAGES = {'.*youtube\.com/watch\?v=(?P<id>.+)': VideoPage,
'.*youtube\.com/index\?ytsession=.+': ForbiddenVideoPage,
'.*youtube\.com/verify_age\?next_url=(?P<next_url>.+)': VerifyAgePage,
PAGES = {r'.*youtube\.com/watch\?v=(?P<id>.+)': VideoPage,
r'.*youtube\.com/index\?ytsession=.+': ForbiddenVideoPage,
r'.*youtube\.com/verify_age\?next_url=(?P<next_url>.+)': VerifyAgePage,
}
@id2url(YoutubeVideo.id2url)