[oauth] adjust Flickr redirect URI (fixes #503)
Flickr now automatically forces https:// for all redirect URIs.
This commit is contained in:
@@ -15,11 +15,14 @@ from ..cache import cache
|
|||||||
import os
|
import os
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
|
REDIRECT_URI_LOCALHOST = "http://localhost:6414/"
|
||||||
|
REDIRECT_URI_HTTPS = "https://mikf.github.io/gallery-dl/oauth-redirect.html"
|
||||||
|
|
||||||
|
|
||||||
class OAuthBase(Extractor):
|
class OAuthBase(Extractor):
|
||||||
"""Base class for OAuth Helpers"""
|
"""Base class for OAuth Helpers"""
|
||||||
category = "oauth"
|
category = "oauth"
|
||||||
redirect_uri = "http://localhost:6414/"
|
redirect_uri = REDIRECT_URI_LOCALHOST
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
Extractor.__init__(self, match)
|
Extractor.__init__(self, match)
|
||||||
@@ -163,7 +166,7 @@ class OAuthBase(Extractor):
|
|||||||
class OAuthDeviantart(OAuthBase):
|
class OAuthDeviantart(OAuthBase):
|
||||||
subcategory = "deviantart"
|
subcategory = "deviantart"
|
||||||
pattern = "oauth:deviantart$"
|
pattern = "oauth:deviantart$"
|
||||||
redirect_uri = "https://mikf.github.io/gallery-dl/oauth-redirect.html"
|
redirect_uri = REDIRECT_URI_HTTPS
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
yield Message.Version, 1
|
yield Message.Version, 1
|
||||||
@@ -182,6 +185,7 @@ class OAuthDeviantart(OAuthBase):
|
|||||||
class OAuthFlickr(OAuthBase):
|
class OAuthFlickr(OAuthBase):
|
||||||
subcategory = "flickr"
|
subcategory = "flickr"
|
||||||
pattern = "oauth:flickr$"
|
pattern = "oauth:flickr$"
|
||||||
|
redirect_uri = REDIRECT_URI_HTTPS
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
OAuthBase.__init__(self, match)
|
OAuthBase.__init__(self, match)
|
||||||
|
|||||||
Reference in New Issue
Block a user