Skip to content

Instantly share code, notes, and snippets.

@steveoni
Created December 20, 2019 00:02
Show Gist options
  • Save steveoni/11a9c66ddacfea225fa8ac1cdb213414 to your computer and use it in GitHub Desktop.
Save steveoni/11a9c66ddacfea225fa8ac1cdb213414 to your computer and use it in GitHub Desktop.
download tweet data
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