GithubHelp home page GithubHelp logo

twitter-video-downloader's Introduction

h4ckNinja's Code

Twitter Follow

Twitch Status

Blog

Cat Dad

๐Ÿ‘‹ Hi! I'm h4ckNinja. I work in offensive security with a focus on web and devops. I enjoy writing scripts and tools and put them here on GitHub to share as my contribution to the community in the hopes that someone finds it useful.

Certifications acquired
Offensive Security Certified Professional
Certified Red Team Operator
GIAC Exploit Researcher and Advanced Penetration Tester (GXPN) (Intentionally let renewal lapse for financial reasons)

If you like my projects, consider tipping me. It helps me fund my caffeine addiction. Not required of course, but very much appreciated.

twitter-video-downloader's People

Contributors

attie avatar h4ckninja avatar jeancf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitter-video-downloader's Issues

Python 3.5.2 @ TypeError: invalid file: PosixPath

I get following error message in Python 3.5.2 when i am trying to download a video:

$ python3 twitter-dl.py -d https://twitter.com/klara_sjo/status/1205228036225949696?s=20
[Debug] [Tweet URL] https://twitter.com/klara_sjo/status/1205228036225949696
[Debug] [Video Player Body]
[Debug] [JS File Body]
[Debug] [Bearer Token] Bearer AAAAAAAAAAAAAAAAAAAAAIK1zgAAAAAA2tUWuhGZ2JceoId5GwYWU5GspY4%3DUq7gzFoCZs1QfwGoVdvSac3IniczZEYXIcDyumCauIXpcAPorE
[Debug] [Player Config JSON]
[Debug] [M3U8 Response]
[+] Multiple resolutions found. Slurping all resolutions.
[+] Downloading 320x320
Traceback (most recent call last):
File "twitter-dl.py", line 200, in
twitter_dl.download()
File "twitter-dl.py", line 94, in download
with open(f, 'rb') as fd:
TypeError: invalid file: PosixPath('output/klara_sjo/1205228036225949696/xgSZf0Zyxmgc1zI0.ts')

Rate limit exceed

Hey, I've tested our tool, I have a problem.
This is the output :

alexis@spectre:~/Documents/Projets/my-secret-website/downloader$ python3 twitter-video-downloader.py -v https://twitter.com/RideForLiife/status/773903597725585408
https://twitter.com/RideForLiife/status/773903597725585408
{'errors': [{'message': 'Rate limit exceeded', 'code': 88}]}
Traceback (most recent call last):
  File "twitter-video-downloader.py", line 104, in <module>
    download(args.video_url)
  File "twitter-video-downloader.py", line 47, in download
    m3u8_url_get = m3u8_url_get['track']['playbackUrl']
KeyError: 'track'

This line :
{'errors': [{'message': 'Rate limit exceeded', 'code': 88}]}
Is because I've print the m3u8_url_get var.

Can you tell me more about the problem ?
Ty, Alexis

`AttributeError: module 'ffmpeg' has no attribute 'input'`

When downloading a video from Twitter, I get the following error:

$  ./twitter-dl.py 'https://twitter.com/helenleigh/status/1319420968964624395'
/usr/local/lib/python3.5/dist-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
[+] Multiple resolutions found. Slurping all resolutions.
[+] Downloading 480x270
        [*] Doing the magic ...
Traceback (most recent call last):
  File "./twitter-dl.py", line 225, in <module>
    twitter_dl.download()
  File "./twitter-dl.py", line 106, in download
    ffmpeg\
AttributeError: module 'ffmpeg' has no attribute 'input'

My system information:

$ python3 --version
Python 3.5.2
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"

Note that the line numbers might be different from the main branch as I've tweaked the source (as per issue #7).

I believe I have fixed the issue. From Googling around, I see ffmpeg-python has an issue that suggests installing ffmpeg-python instaed of ffmpeg. Installing ffmpeg-python instead of ffmpeg resolves the issue for me.

pip install ffmpeg-python

Note I probably bungled the install as I see ffmpeg-python listed in the requirements.txt, so this issue should only maybe serve as a reminder to either install ffmpeg-python or to make sure a propper install was done of this repo.

how to find the prefix url you posted ? that's amazing

Thanks for you sharing.

I analyze the twitter website and see the http request the firefox send, but I how to get the video url , I don't know how to compose it. I think that maybe I need it's developer account of twitter, but during requesting, I found your git.

I want to know how to find this url .
thanks in advance.

twitter video download error traceback

Describe the bug
It is not possible to download any Twitter Video.

I have installed all required modules and everything is up to date.

Desktop (please complete the following information):

  • OS: Debian GNU/Linux 10 (buster) x86_64
    4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 GNU/Linux

Error Traceback:
python3 -d twitter-dl.py https://twitter.com/Mrtdogg/status/1266952147834470408
[+] Multiple resolutions found. Slurping all resolutions.
[+] Downloading 320x528
[*] Doing the magic ...
Traceback (most recent call last):
File "twitter-dl.py", line 200, in
twitter_dl.download()
File "twitter-dl.py", line 100, in download
ffmpeg
AttributeError: module 'ffmpeg' has no attribute 'input'

Solved with kkroening/ffmpeg-python#174

Add GIF download support

Here is the relevant detail:

$ ./twitter-dl.py 'https://twitter.com/josecastillo/status/1319682792763101198'
/usr/local/lib/python3.5/dist-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
[-] Sorry, single resolution video download is not yet implemented. Please submit a bug report with the link to the tweet.

Details on my system:

$ /usr/bin/env python3 --version
Python 3.5.2
$ uname -a
Linux mill 4.4.0-193-generic #224-Ubuntu SMP Tue Oct 6 17:15:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"

Single resolution not implemented

Hi, thanks for your script. I'm using to download several videos at once, but some give me this error:

[Debug] [Tweet URL] https://twitter.com/ThiagoTisca/status/1158118513682395136
[Debug] [Video Player Body]
[Debug] [JS File Body]
[Debug] [Bearer Token] Bearer AAAAAAAAAAAAAAAAAAAAAIK1zgAAAAAA2tUWuhGZ2JceoId5GwYWU5GspY4%3DUq7gzFoCZs1QfwGoVdvSac3IniczZEYXIcDyumCauIXpcAPorE
[Debug] [Player Config JSON]
[Debug] [M3U8 Response]
[-] Sorry, single resolution video download is not yet implemented. Please submit a bug report with the link to the tweet.
[Debug] [Tweet URL] https://twitter.com/Mattheuss827/status/1157788625406500866
[Debug] [Video Player Body]
[Debug] [JS File Body]
[Debug] [Bearer Token] Bearer AAAAAAAAAAAAAAAAAAAAAIK1zgAAAAAA2tUWuhGZ2JceoId5GwYWU5GspY4%3DUq7gzFoCZs1QfwGoVdvSac3IniczZEYXIcDyumCauIXpcAPorE
[Debug] [Player Config JSON]
[Debug] [M3U8 Response]
[-] Sorry, single resolution video download is not yet implemented. Please submit a bug report with the link to the tweet.

I would like to check if every occurrence of this error is due the fact the tweets actually contains GIFs.

video downlaod error

when download a video it's not always success, offen show this erorr:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='abs.twimg.com', port=443): Max retries exceeded with url: /web-video-player/TwitterVideoPlayerIframe.cefd459559024bfb.js (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')")))

Download Twitter video error.

Describe the bug

When I download a video from twitter, it raise an error said:

[+] Multiple resolutions found. Slurping all resolutions.
[+] Downloading 480x270
	[*] Doing the magic ...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbcc8808200] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbcc8808200] error reading header
output/i/1390791912173424643/480x270.ts: Invalid data found when processing input

To Reproduce

twitter-dl.py https://twitter.com/i/status/1390791912173424643

Expected behavior

download video successful.

Desktop (please complete the following information):

  • OS: macOS

This has stopped working

player_config_req = self.requests.get(self.video_api + self.tweet_data['id'] + '.json')
get HTTP 404 at the above line.

Traceback (most recent call last):
File "twitter-dl.py", line 225, in
twitter_dl.download()
File "twitter-dl.py", line 59, in download
video_host, playlist = self.__get_playlist(token)
File "twitter-dl.py", line 147, in __get_playlist
player_config = json.loads(player_config_req.text)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.