add mime parser: flickr.com

This commit is contained in:
woorst
2017-10-11 17:27:37 -05:00
parent c0eedd716e
commit e89c620e0e
3 changed files with 1040 additions and 0 deletions

View File

@@ -438,6 +438,14 @@ class MakeamemeMIMEParser(OpenGraphMIMEParser):
pattern = re.compile(r'https?://(www\.)?makeameme\.org/meme/.+$')
class FlickrMIMEParser(OpenGraphMIMEParser):
"""
Flickr uses the Open Graph protocol
"""
pattern = re.compile(r'https?://(www\.)?flickr\.com/photos/[^/]+/[^/]+/?$')
# TODO: handle albums/photosets (https://www.flickr.com/services/api)
# Parsers should be listed in the order they will be checked
parsers = [
ClippitUserMIMEParser,
@@ -452,6 +460,7 @@ parsers = [
YoutubeMIMEParser,
LiveleakMIMEParser,
TwitchMIMEParser,
FlickrMIMEParser,
GifsMIMEParser,
GiphyMIMEParser,
ImgtcMIMEParser,

File diff suppressed because it is too large Load Diff

View File

@@ -118,6 +118,10 @@ URLS = OrderedDict([
'http://makeameme.org/meme/joined-reddit-for',
'https://media.makeameme.org/created/joined-reddit-for.jpg',
'image/jpeg')),
('flickr', (
'https://www.flickr.com/photos/obamawhitehouse/8191317327/',
'https://c1.staticflickr.com/9/8065/8191317327_5180e95d98_b.jpg',
'image/jpeg')),
])