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

Can this be used with user account for a private instance? #45

Closed
muhitrhn opened this issue Feb 15, 2024 · 16 comments
Closed

Can this be used with user account for a private instance? #45

muhitrhn opened this issue Feb 15, 2024 · 16 comments

Comments

@muhitrhn
Copy link

muhitrhn commented Feb 15, 2024

What would be an example of the config needed to run this repo with a user account?

@PrivacyDevel
Copy link
Owner

I've pretty much just used this script to generate the content for my guest_accounts.jsonl: zedeus#983 (comment)
Fill in your username and password and execute it once for each Twitter account, copy the required fields and paste it into your guest_accounts.jsonl like so:

{"oauth_token": "xxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "oauth_token_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
{"oauth_token": "xxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "oauth_token_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
{"oauth_token": "xxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "oauth_token_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

@paquirodeniro2
Copy link

where should the guest_accounts.jsonl be located?

@rotorot0
Copy link

rotorot0 commented Mar 3, 2024

It should be put in the same folder where the nitter binary is.

@N-R-K
Copy link

N-R-K commented Mar 3, 2024

where should the guest_accounts.jsonl be located?

Put it wherever you want and set the NITTER_ACCOUNTS_FILE environment variable to that location. Otherwise nitter will look at the current directory.

@mischif
Copy link

mischif commented Mar 8, 2024

Related question, is using cookie values from a logged-in user supposed to work when you build from the head of master? Nitter still won't run without the guest tokens, and I get segfaults when I try to use other branches and leave them out

@rotorot0
Copy link

rotorot0 commented Mar 8, 2024

Related question, is using cookie values from a logged-in user supposed to work when you build from the head of master? Nitter still won't run without the guest tokens, and I get segfaults when I try to use other branches and leave them out

Did you put the cookie information in the nitter.conf file only? As stated here, you need to generate the necessary info for the guest_accounts.jsonl file.

@mischif
Copy link

mischif commented Mar 9, 2024

As I understand the current codebase, guest_accounts.json is for short-term credentials from when you create anonymous guest accounts instead of a "real" account (hence the name); if I understand this comment correctly, I shouldn't need a guest_accounts.json file if I enter the cookie info into nitter.conf.

When I created a guest_accounts.json file I didn't need to enter cookie info, but I encountered a different bug where nitter crashed if I didn't use the service for half an hour or so, but bouncing the service fixed it.

@rotorot0
Copy link

rotorot0 commented Mar 9, 2024

As I understand the current codebase, guest_accounts.json is for short-term credentials from when you create anonymous guest accounts instead of a "real" account

Guest accounts are not supported anymore, twitter took the API that generated those tokens down.

if I understand zedeus#830 (comment) correctly, I shouldn't need a guest_accounts.json file if I enter the cookie info into nitter.conf.

That PR is a little old now. It has no mentions of guest accounts.

When I created a guest_accounts.json file I didn't need to enter cookie info, but I encountered a different bug where nitter crashed if I didn't use the service for half an hour or so, but bouncing the service fixed it.

What branch are you using? I've setup mine from PrivacyDev's master branch, with both the cookie header info AND guest_accounts.jsonl file with 4 real accounts and I've had no issues whatsoever.

@mischif
Copy link

mischif commented Mar 9, 2024

Guest accounts are not supported anymore, twitter took the API that generated those tokens down

I know that, which is why my Nitter instance refusing to run unless I have a guest_accounts.json file is confusing

That PR is a little old now. It has no mentions of guest accounts

The code from that PR is merged into the master branch, so I would expect it to still function correctly

I am using commit cb0d360 from the master branch; the issue is including the cookie info in my config file seems to do nothing (I can remove it and access everything I can with just the guest_accounts.json file), the issue with the service failing after 30 minutes of inactivity is separate

@rotorot0
Copy link

rotorot0 commented Mar 9, 2024

I know that, which is why my Nitter instance refusing to run unless I have a guest_accounts.json file is confusing

The file name is irrelevant, what matters is its function. Without it, nitter will not be able to do anything, so that's why it doesn't start.
image

Just add a real account to the guest_accounts.jsonl file using the instructions here #45 (comment). The cookie header is just so you can see NSFW content and likes too.

image

@muhitrhn
Copy link
Author

muhitrhn commented Apr 4, 2024

Thanks @PrivacyDevel ! Worked like a charm! But I was not able to make the Likes tab working. Any help in that case?

@rotorot0
Copy link

rotorot0 commented Apr 5, 2024

#42 has a PR linked to it to add a fix

@muhitrhn
Copy link
Author

muhitrhn commented Apr 5, 2024

Thanks @rotorot0 ! Followed that and it's working now!

@muhitrhn
Copy link
Author

muhitrhn commented Apr 7, 2024

How can I create a query to filter only tweets from search? I tried this but doesn't work

Query(kind: posts, fromUser: @[username], excludes: @["replies", "retweets", "nativeretweets", "quotes"])

@muhitrhn
Copy link
Author

Anyone? @rotorot0 @PrivacyDevel

@muhitrhn
Copy link
Author

Also, do I need to use proxy in case I am using multiple accounts?

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

6 participants