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

[Question] Is there a way to use a twitter acc in combination with nitter (or an alternative twitter front end using your twitter login) #1195

Open
back-lacking opened this issue Apr 14, 2024 · 21 comments

Comments

@back-lacking
Copy link

what the question says
wondering if there is a way to use nitter with a twitter account? i have an account i dont care about and would like to use that to view the occasional tweet using the front end. ik that using an twitter acc to look at tweets using nitter defeats the point of nitter existing
if there isnt, is there an alternative service or nitter fork that allows this?

@pin-grid-array
Copy link

Yes, there is a way. Actually, that's the only way left to use Nitter.

I recently learned that that's exact how https://github.com/PrivacyDevel/nitter is able to continue to functioning these days. It's also how they have been able to display age-restricted content.

@back-lacking
Copy link
Author

@pin-grid-array i see. Can i know how this is done?

@pin-grid-array
Copy link

@back-lacking I actually don't know how. I'm just a former ordinary Nitter user and it's beyond my expertise. Ask in that fork.

A while ago I collected various instructions from people who tried setting up their own instance using a Twitter account, but I don't know if any of that still applies.

(I just noticed that there are a bunch of typos in my previous reply to you. Sorry about that!)

@brokewq
Copy link

brokewq commented May 30, 2024

@back-lacking hey dude did you find any way to use nitter with a twitter ac ?

@doffn
Copy link

doffn commented Jun 11, 2024

@back-lacking hey dude did you find any way to use nitter with a twitter ac ?

you can use other ways aside from nitter. If you are planning to use ur twitter account. I can share you hwhat i use

@back-lacking
Copy link
Author

@doffn if you do have a 3rd party viewer, send it in. Perferebly one that can be deployed on docker.
On a side note, on android i use an app called quacker. Its on fdroid.

@doffn
Copy link

doffn commented Jun 19, 2024

@doffn if you do have a 3rd party viewer, send it in. Perferebly one that can be deployed on docker. On a side note, on android i use an app called quacker. Its on fdroid.

@back-lacking sorry for the late response. I used two methods to scrape tweets:

  1. Using twitter-api-client : require cto and auth_token from your cookies. You can direcly tweet, dm, follow , like and scrape tweets using this. this require the latest python version. It can also scrape multiple account at once.
  2. Using tweety: this requires the full session. i use this to scrape tweets. I didnot find any inherent way to scrape multiple account at once.

After getting the data do what ever you like with it. becare full on the rate limit. You can avoid this by using multiple account.

@rinaldi6109
Copy link

@back-lacking hey dude did you find any way to use nitter with a twitter ac ?

you can use other ways aside from nitter. If you are planning to use ur twitter account. I can share you hwhat i use

I'm interested. Can you tell me how? Thank you.

@back-lacking
Copy link
Author

@rinaldi6109 im using a fork made by privacydevel. Its been posted earlier by pingridarray. I can later post a docker compose that i got working.

@codeiimon
Copy link

@back-lacking If you could post the docker compose you got working that would be awesome. I'm very interested.

@back-lacking
Copy link
Author

@codeiimon edited this compose to have it work in most environments.

version: "3"
services:
  nitter:
    image: ghcr.io/privacydevel/nitter:master
    container_name: nitter
    ports:
      - "8080:8080" # Replace with "8080:8080" if you don't use a reverse proxy
    volumes:
      - ./nitter.conf:/src/nitter.conf:Z,ro
      - ./guest_accounts.json:/src/guest_accounts.json:ro
    depends_on:
      - nitter-redis
    restart: unless-stopped
    networks:
      - nitter
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:8080/Jack/status/20 || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
    user: 998:998
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
  nitter-redis:
    image: redis:6-alpine
    container_name: nitter-redis
    hostname: nitter-redis
    ports:
      - 6379
    command: redis-server --save 60 1 --loglevel warning
    networks:
      - nitter
    volumes:
      - nitter-redis:/data
    restart: unless-stopped
    healthcheck:
      test: redis-cli ping
      interval: 30s
      timeout: 5s
      retries: 2
    user: 999:1000
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
volumes:
  nitter-redis: null
networks:
  nitter:

@dhdurgee
Copy link

dhdurgee commented Nov 6, 2024

@back-lacking I have been using https://nitter.privacydev.net/MarkDavis/ to keep up with a particular "twitter" user and am lately getting annoyed with almost constant "Instance has been rate limited." responses there. I have a "twitter" account, but I very much prefer the Nitter presentation.

I am running Linux Mint 22 here. I would be willing to install Nitter on my system here strictly for my own use, but I would need pointers to a complete "recipe" to accomplish this. I have checked both the synaptic package manager and the software manager on my system and do not see Nitter as an installable option. Both show many hits on "docker" but I have no idea which I would actually need to install to make use of your "compose" above or how to install my "twitter' credentials in it.

Any assistance you can give me would be appreciated.

Dave

@cmj
Copy link

cmj commented Nov 6, 2024

@dhdurgee If you're just getting started, I believe the only method is to use a fork that just uses a single account. You no longer can create oauth tokens as of a couple months ago.

https://github.com/cmj/nitter/wiki/Install

As far as using docker images, that's not something I've looked at; I just run it directly. This fork seems to be working well for my personal use for a few months now. All multi-account management has been stripped as it was just a PoC. Maybe that can be added back later.

@dhdurgee
Copy link

dhdurgee commented Nov 7, 2024 via email

@back-lacking
Copy link
Author

@dhdurgee
i dont run nitter standalone (i run it as a docker container) as i run it with other things in my homelab but i have posted my docker compose config in an earlier comment. getting docker setup on your system isnt that difficult. follow the instructions from the docker documentation and youll be fine.

@dhdurgee
Copy link

dhdurgee commented Nov 8, 2024

@cmj As noted above I believe I have found the dependencies you listed in my repositories, bu t I do not see nimble there and from the installation guide that is also required. Where do I get nimble and what are its dependencies?

@cmj
Copy link

cmj commented Nov 8, 2024

@dhdurgee apt install nim

@dhdurgee
Copy link

dhdurgee commented Nov 8, 2024

@cmj I just installed nim and started following your installation guide.

First line yields "permission denied", but worked when invoked with sudo.

Second line fails with "Authentication failure"

Once again I find this works when invoked with sudo, but at this point I am wondering what else I will encounter as the /opt/ directory has user and group as root. I anticipate the next step will fail as nitter does not have permission.

How do I accomplish this? I am running Linux Mint 22 Cinnamon here.

Perhaps I need to chgrp the /opt/ directory from root to adm or staff and add nitter to that group first?

@cmj
Copy link

cmj commented Nov 8, 2024

There are many install howtos out there.

https://github.com/sekai-soft/guide-nitter-self-hosting

This may be out-of-date but should help?

That said, you will need to use cookies from now on.

@wuaikaiyuan
Copy link

ghcr.io/privacydevel/nitter

I used your docker-compose.yml configuration, but still can't check the data, my nitter.conf configuration is as follows:


[Server]
hostname = "nitter.net"  # for generating links, change this to your own domain/ip
title = "nitter"
address = "0.0.0.0"
port = 8080
https = false  # disable to enable cookies when not using https
httpMaxConnections = 100
staticDir = "./public"

[Cache]
listMinutes = 240  # how long to cache list info (not the tweets, so keep it high)
rssMinutes = 10  # how long to cache rss queries
redisHost = "nitter-redis"  # Change to "nitter-redis" if using docker-compose
redisPort = 6379
redisPassword = ""
redisConnections = 20  # minimum open connections in pool
redisMaxConnections = 30
# new connections are opened when none are available, but if the pool size
# goes above this, they're closed when released. don't worry about this unless
# you receive tons of requests per second

[Config]
hmacKey = "secretkey"  # random key for cryptographic signing of video urls
base64Media = false  # use base64 encoding for proxied media urls
enableRSS = true  # set this to false to disable RSS feeds
enableDebug = false  # enable request logs and debug endpoints (/.accounts)
proxy = ""  # http/https url, SOCKS proxies are not supported
proxyAuth = ""
tokenCount = 10
# minimum amount of usable tokens. tokens are used to authorize API requests,
# but they expire after ~1 hour, and have a limit of 500 requests per endpoint.
# the limits reset every 15 minutes, and the pool is filled up so there's
# always at least `tokenCount` usable tokens. only increase this if you receive
# major bursts all the time and don't have a rate limiting setup via e.g. nginx

# Headers
cookieHeader="guest_id=v1%3A171532054134826399; _ga=GA1.2.1201484534.1716181816; night_mode=2; guest_id_marketing=v1%3A171532054134826399; guest_id_ads=v1%3A171532054134826399; g_state={'i_l':0}; kdt=dh2qglbIjkbD1vr7u2TcIq5zvbojxBkjSbB89EDz; auth_token=77b3ffcc346039bc0c338f502b; ct0=7c128fdf65d71d59208a94ad; twid=u%3D1451015154196353027; personalization_id='v1_dwfqqxplZuP9jx5vwnMySg=='; lang=en"
xCsrfToken="7c128fdf"

# Change default preferences here, see src/prefs_impl.nim for a complete list
[Preferences]
theme = "Nitter"
replaceTwitter = "nitter.net"
replaceYouTube = "piped.video"
replaceReddit = "teddit.net"
proxyVideos = true
hlsPlayback = false
infiniteScroll = false

@cmj
Copy link

cmj commented Dec 25, 2024

Your xCsrfToken should be the same as the ct0 value in the cookie. Probably shouldn't share the auth_token either (not sure if that's intentionally used for this example) so you should at least log out of all known sessions and start fresh.

You also only really need auth_token and ct0 in the cookie header. And it looks like I'll edit my previous comment. You can still create oauth tokens it's just the login flow has changed a bit to get them a few months ago.

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

9 participants