#!/usr/bin/env python __all__ = ['twitter_download'] from ..common import * from .vine import vine_download def twitter_download(url, output_dir='.', merge=True, info_only=False, **kwargs): html = get_html(url) screen_name = r1(r'data-screen-name="([^"]*)"', html) item_id = r1(r'data-item-id="([^"]*)"', html) page_title = "{} [{}]".format(screen_name, item_id) try: # extract video icards = r1(r'data-src="([^"]*)"', html) if icards: card = get_html("https://twitter.com" + icards) data_player_config = r1(r'data-player-config="([^"]*)"', card) if data_player_config is None: vine_src = r1(r'