Created
December 20, 2019 00:02
-
-
Save steveoni/11a9c66ddacfea225fa8ac1cdb213414 to your computer and use it in GitHub Desktop.
download tweet data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pytube import YouTube | |
from twitterdl import TwitterDownloader | |
import re | |
import wget | |
from datetime import datetime | |
def download_img(tweet): | |
dir = "img/" | |
img = tweet.entities["media"][0]["media_url"] | |
img_path = wget.download(img,dir) | |
def tweet_media(tweet_url): | |
o = TwitterDownloader(tweet_url) | |
o.download() | |
def tweet_utube(tweet_url): | |
yt = YouTube(tweet_url) | |
y = yt.streams.filter(progressive=True, file_extension='mp4') | |
y = y.order_by('resolution') | |
y = y.desc().first() | |
vid_path = y.download("./output") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment