mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05:10 +01:00
Move to RapidAPI url's for favicon API
This commit is contained in:
@@ -197,14 +197,14 @@ class Bookmark(BaseModel):
|
|||||||
def _set_favicon_with_realfavicongenerator(self, domain):
|
def _set_favicon_with_realfavicongenerator(self, domain):
|
||||||
""" Fetch favicon for the domain """
|
""" Fetch favicon for the domain """
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
'https://realfavicongenerator.p.mashape.com/favicon/icon?platform=android_chrome&site=' + domain,
|
'https://realfavicongenerator.p.rapidapi.com/favicon/icon?platform=android_chrome&site=' + domain,
|
||||||
stream=True,
|
stream=True,
|
||||||
headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY}
|
headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY}
|
||||||
)
|
)
|
||||||
if response.status_code == 404:
|
if response.status_code == 404:
|
||||||
# Fall back to desktop favicon
|
# Fall back to desktop favicon
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
'https://realfavicongenerator.p.mashape.com/favicon/icon?platform=desktop&site=' + domain,
|
'https://realfavicongenerator.p.rapidapi.com/favicon/icon?platform=desktop&site=' + domain,
|
||||||
stream=True,
|
stream=True,
|
||||||
headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY}
|
headers={'User-Agent': DIGIMARKS_USER_AGENT, 'X-Mashape-Key': settings.MASHAPE_API_KEY}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user