Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install this? And some other things. #5

Open
UchuuStranger opened this issue Apr 14, 2021 · 4 comments
Open

How to install this? And some other things. #5

UchuuStranger opened this issue Apr 14, 2021 · 4 comments

Comments

@UchuuStranger
Copy link

I'm looking for a program that can scrape all the media from a particular Twitter account without the 3200 limitation of Twitter API. One of the users on Reddit referred me to twint, and raw twint does not seem to be what I'm looking for. But through it I found twint-utils, and through that I found you and your TwitterMediaDownloader, which does seem to be what I'm looking for. But the issue is, while I do have some experience with Python, I don't have all that much experience with GitHub, so I'm struggling to use your program.

So when I ran the command "!pip3 install twint", twint was successfully installed in my Jupyter Notebook. But commands "!pip3 install twint_utils" and "!pip install TwitterMediaDownloader" failed to produce the same result. I assume this has something to do with the latter two not being released on PyPl. I know how to download a GitHub repository locally, but I don't know how to use it to install the package into Python. A little help?

Also, when I tried pasting your raw code from media_downloader.py and twitter.py, both codes give me a SyntaxWarning: "is" with a literal. Did you mean "=="? . Any idea what's up with that?

@UchuuStranger
Copy link
Author

And apologies in advance for creating an issue to contact you. I can't find your email on your account, or any better way to reach you.

@11philip22 11philip22 pinned this issue Apr 14, 2021
@11philip22
Copy link
Owner

Hi UchuuStranger, This is the correct way of reaching out :) I first wanna tell you that this program is probably not working a the moment. I wrote this before twitter stopped showing tweets if you have javascript disabled. And with python we are just sending raw http reqeuests so no javascript gets rendered. To circumvent this i have to enumarate the API that twitters javascript uses to load in resources. I have already started working on this. But i am stuck on generating a the cookie. I should probably put the current status of the project in the description. For the syntax warning: I wrote this two years ago when i was still kinda new to python. This was my first "big" project. So it means that i put an is where i should put an ==. The reason why your pip commands fail is because twint utils and this project are not packaged on pip.
TLDR: program not working due to twitter changes over the past two years and i am slowly trying to fix it.
Thanks for reaching out!

@UchuuStranger
Copy link
Author

Thanks, I appreciate your response. I understand what you're saying about your program currently not working, but I'd still like to know how to install GitHub packages in general. For example, the twint_utils page has a code snippet that starts with from twint_utils.tweets import media_downloader. When I run this command, I get an error No module named 'twint_utils'. Which makes sense, because I did not install this module. So my question is: how do I install it without pip? Is there a guide somewhere you can refer me to?

@11philip22
Copy link
Owner

11philip22 commented Apr 14, 2021

Well github is not a packaging system (Tho it has one. But not sure for python) Its a code repository. So you can download the files by installing git https://git-scm.com/book/en/v2/Getting-Started-Installing-Git . And then you can run git clone <repo url> to download the files locally to your computer. Then you can place the files in your project and import the files

import <module name>

The module name is the file name without the .py extension. Or you could copy paste into your jupyter notebook like you did.
Every python file is a "module" and every folder containing pyton files and a __init__.py is considered a "package"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants