Coder Social home page Coder Social logo

shalvah / downloadthisvideo Goto Github PK

View Code? Open in Web Editor NEW
667.0 667.0 80.0 688 KB

Twitter bot for easily downloading videos/GIFs off tweets

Home Page: http://download-this.video

License: GNU General Public License v3.0

JavaScript 51.74% PowerShell 0.51% Handlebars 47.75%
aws-lambda bot lambda-functions nodejs serverless twitter

downloadthisvideo's Introduction

shalvah

Shalvah (yes, me😝) on your command-line.

npm install -g shalvah

shalvah

Seriously, I got bored of websites and turned my personal site into a Node package. ¯_(ツ)_/¯

There's still a website, though. It makes use of this package. Oh, and I wrote a thing about how I built this package.

downloadthisvideo's People

Contributors

hacktivist123 avatar notpushkin avatar shalvah 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  avatar  avatar  avatar  avatar  avatar

downloadthisvideo's Issues

Twitter linking is broken

I can click "Enable notifications" and it asks to sign in to Twitter to authorize the action. I go through the authorization and the redirect takes me to localhost on port 8080.

Investigate Redis connection issues

This error was observed at 03:04:39 on 20 March 2019:

ERR max number of clients reached

Around that time, AWS Lambda says there were 309 concurrent invocations. (a local maximum, but not the highest that day). The Redis instance logs show no unusual activity.

This can probably be mitigated by using connection pooling (which is not trivial to implement in a serverless environment.

Add support for Vines

Downloading Vine videos doesn't work. The app throws a NoVideoInTweet error, because no media entities show up in the tweet object.

Sample tweet containing Vine:

{
    "created_at": "Wed Jul 04 01:28:00 +0000 2018",
    "id": 1014319887248961500,
    "id_str": "1014319887248961536",
    "full_text": "Running away from ur responsibilities like https://t.co/JgisIc1c1f",
    "truncated": false,
    "display_text_range": [
        0,
        66
    ],
    "entities": {
        "hashtags": [],
        "symbols": [],
        "user_mentions": [],
        "urls": [
            {
                "url": "https://t.co/JgisIc1c1f",
                "expanded_url": "http://vine.co/v/iV3lbUwgYDX",
                "display_url": "vine.co/v/iV3lbUwgYDX",
                "indices": [
                    43,
                    66
                ]
            }
        ]
    },
    "source": "<a href=\"https://buffer.com\" rel=\"nofollow\">Buffer</a>",
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "user": {
        // ...
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 11134,
    "favorite_count": 19079,
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "lang": "en"
}

You can see that the Vine video shows up as a url, rather than as media. We could return the expanded_url property, but that only links to the Vine page.

Useful resources

PWA support

Hi Shalvah, I was thinking instead of opening the browser every time, wouldn't it be nice if the web app is made an installable PWA?

i18n capabilities

Related issue:
#15

Why is it that hard?

  1. Check the mentioner's language (profile or account or something)
  2. Original post language (maybe some metadata, or custom detection logic from the tweet body.
  3. A custom bot parameter e.g.: @this_vid en or @this_vid_en or @this_vid lang:en or something

I do not want to fork the repository. I might open a pull request with a solution, but I need your guidance!

  1. Twitter mention API provides a user object and there is a lang field in it.
  2. The code is looking for the referenced tweet as well and twitter status lookup API provides a similar (if not the same) user object with a lang field

So as far as I see we can accomplish the i18n-ing. I can create a pull request.
Any extra info @shalvah?

Massive edit:

https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/user-object

lang | null | Value will be set to null. Still available via GET account/settings as language

Oh what a pity!

Automated replies don't show up under the tweet and in notifications

Even though the bot has replied to a tweet (and the reply count reflects this), the reply does not show up when you click on the tweet, neither is a notification dispatched. The only way to view the reply is if you're following the bot, in which case it shows up on your timeline.

Add Travis CI

So deploys don't need to depend on the maintainer's machine

How To install

Hello, I'm having trouble installing. I sent a message to the producer, no response. How can I install? What files should I configure other than the .env file?

Add favicon and Title to /beta/USERNAME

Currently, /beta/USERNAME doesn't show any <title>, instead just a URL - this may be confusing for some users, and showing something like "This_Vid - @USERNAME" might be a better idea. Furthermore, no favicon is included, which means in some browsers the site might look slightly off.

I completely understand that these are pedantic issues and I completely understand if you close the issue, it'd just be nicer as formatting 😉

No check for being blocked

If you're going to make an account that lets people just freeboot stuff without consent, you could at least make it opt-out

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.