Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flixel] Add new extractor #14899

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
from .fivetv import FiveTVIE
from .flickr import FlickrIE
from .flipagram import FlipagramIE
from .flixel import FlixelIE
from .folketinget import FolketingetIE
from .footyroom import FootyRoomIE
from .formula1 import Formula1IE
Expand Down
35 changes: 35 additions & 0 deletions youtube_dl/extractor/flixel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor


class FlixelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?flixel\.com/cinemagraph/(?P<id>[0-9a-zA-Z]+)'
_TEST = {
'url': 'https://flixel.com/cinemagraph/tg64m4fmxbqu5yrywoz5/',
'md5': '374a8a8f8902f7db0f4a8d6f580c23ed',
'info_dict': {
'id': 'tg64m4fmxbqu5yrywoz5',
'ext': 'mp4',
'title': 'ROSSIO',
'uploader': 'capn',
'duration': 3.575,
'thumbnail': 'https://cdn.flixel.com/flixel/tg64m4fmxbqu5yrywoz5.thumbnail.jpg?v=1',
'webpage_url': 'https://flixel.com/cinemagraph/tg64m4fmxbqu5yrywoz5/',
}
}

def _real_extract(self, url):
video_id = self._match_id(url)
json_url = 'https://api.flixel.com/2/flixels/{0}'.format(video_id)
meta = self._download_json(json_url, video_id)
return {
'id': video_id,
'title': meta.get('caption'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title is mandatory.

'url': meta.get('hd_mp4'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More video qualities are available.

'uploader': meta.get('username'),
'duration': meta.get('duration'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float_or_none.

'thumbnail': meta.get('thumbnail'),
'webpage_url': meta.get('link'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

}