-
-
Notifications
You must be signed in to change notification settings - Fork 543
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
added login-based workaround to view NSFW content #830
Conversation
How is this going to work in the end? |
If this pull request got accepted and people updated, they would have the choice to either
|
This comment was marked as resolved.
This comment was marked as resolved.
@@ -40,7 +41,13 @@ proc getConfig*(path: string): (Config, parseCfg.Config) = | |||
enableRss: cfg.get("Config", "enableRSS", true), | |||
enableDebug: cfg.get("Config", "enableDebug", false), | |||
proxy: cfg.get("Config", "proxy", ""), | |||
proxyAuth: cfg.get("Config", "proxyAuth", "") | |||
proxyAuth: cfg.get("Config", "proxyAuth", ""), | |||
cookieHeader: cfg.get("Config", "cookieHeader", ""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PrivacyDevel This is inconvenient to use when the values can change around if using it in a docker container.
Please change it to
cfg.get("Config", "cookieHeader", getEnv("cookieHeader", "") )
cfg.get("Config", "xCsrfToken", getEnv("xCsrfToken", "") )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running docker containers through nice web frontends this makes it easy to change the files without needing to screw around with the twitter conf and getting the cookieHeader
all properly escaped for the .conf
, because you can just paste it into a text box and it handles the escaping.
Does this "fix" #919? For public instances this might be hard to implement, but for personal instances, this would be acceptable. |
I just set up a private instance, it works well. |
Would you mind sharing your ways? |
I am not sure what you missed, but these are my steps:
I am able to access individual user profiles as well. |
It's not working for me, but I think it may be more fundamental, as I've not built nitter before. For a start, the Nitter "front page" is stuffed, with over-sized images, suspect some CSS is AWOL. 404 Not Found: --- url: https://api.twitter.com/graphql/somecodehere/UserByScreenName?variables=...etc |
The CSS is probably unrelated to the main functionality not working, but if I fetch http://localhost:8080/css/style.css I actually get an HTML Nitter error not the CSS file. |
CSS fixed, I had neglected the nimble scss (which by its name is plainly related!) Still get 404 out of Twitter though :( |
Does it work when you are using my fork instead? |
I started from a git clone of nitter, created a new branch and pulled in your nsfw pull req. I've not yet tried a direct clone of your branch, but I will. I copied my working nitter.conf and added the two new auth fields which I'll partially paste below. I'll do a more detailed diff of that and your updated example in case I missed something else. I do have your changes locally, and have rebuilt. Oh. But I added some extra debug to print the new fields and that's not coming out, either meaning my config is not being picked up, or it's not somehow rebuilt properly? .. in [Config] section after the comment describing them That's interesting, the ct0 and Csrf are the same, I'd not noticed that. Expected? I'm sure I double checked them. Version 2023.07.06-bb7e239 |
It is rebuilding OK, but my debug is bogus, possibly due to not understanding nim, so I can't verify what it's using, if anything, for the auth headers. Tried to add echos to proc fetch. Builds but nothing printed, although I can adjust the error output that I get. |
OK, a raw build of your branch behaves differently, I now get the error occured in one of your routes that @Mendelrock reported above. And the debug still reports a 404 coming back from the API URL. I think that error may be a symptom of the 404, as Z's master now has a JSON parser/exception fix that you haven't yet got, I think (but I have in my other build as I merged nsfw onto his latest). So I still have some issue somewhere. |
Right, not sure what I was doing wrong, but I do get debug now, and upon the 404 I print my auth tokens and they are as I expect. But I can see zero evidence of them being used. The only time they are picked up is in the proc fetch (as above) and debug does not show this being called. I get errors from proc fetchRaw. It is a bit more complex as well. If I search for the user (BungieHelp FWIW) I do get results. But if then click on a user name (that or any others), it comes back not found (well, a 404, which Z's master has a fix-ish for, so "not found" instead of the above routes error message). I'm wondering: does your patch only add auth to the points where you found it was previously required (like search) and it is not present in the path that is used for a user view / feed (and so that now fails)? |
Confirmed! This fixes user feeds:
|
I tried this pr today. While RSS retrieval is functioning, it seems that the search functionality is not working properly. |
This won't be needed anymore |
Based on, preferred over and resolves #825
Closes #829 (and closes #302)