Open lolums1231 opened 5 months ago
Edit the script and just add this
// @match https://x.com/*
This works to get the download button back but doesn't fix the "Error" or "X" from appearing when using on both video and images.
Enabling "Strict Tracking Protection Fix" allows images to be saved, but "Error" on videos, with it disabled obviously neither video or image downloading works.
When downloading an image, the account name in the saved file name appears as "undefined" for all images, something isn't working specifically for x.com. Where as on twitter.com hours earlier without any other changes was fully functional.
Running up-to-date Tampermonkey and Firefox with script version 1.9.1-2023.12.19 + // @match https://x.com/*
On this line
get author() {
//return this.url.match(/(?<=twitter\.com\/).+?(?=\/)/)?.[0];
}
Change it to
get author() {
//return this.url.match(/(?<=x\.com\/).+?(?=\/)/)?.[0];
}
to fix the name
On this line
get author() { //return this.url.match(/(?<=twitter\.com\/).+?(?=\/)/)?.[0]; }
Change it to
get author() { //return this.url.match(/(?<=x\.com\/).+?(?=\/)/)?.[0]; }
to fix the name
This helped fix the name
All the changes I've made
// if not an opened tweet
if (!location.href.match(/x\.com\/[^\/]+\/status\/\d+/)) {
to
// if not an opened tweet
if (!location.href.match(/twitter\.com\/[^\/]+\/status\/\d+/)) {
static goFromMobileToMainSite() { // uncompleted
if (location.href.startsWith("https://mobile.twitter.com/")) {
location.href = location.href.replace("https://mobile.twitter.com/", "https://twitter.com/");
to
static goFromMobileToMainSite() { // uncompleted
if (location.href.startsWith("https://mobile.x.com/")) {
location.href = location.href.replace("https://mobile.x.com/", "https://x.com/");
get author() {
return this.url.match(/(?<=twitter\.com\/).+?(?=\/)/)?.[0];
to
get author() {
return this.url.match(/(?<=x\.com\/).+?(?=\/)/)?.[0];
const urlBase = `https://twitter.com/i/api/graphql/${API.TweetDetailQueryId}/TweetDetail`;
to
const urlBase = `https://x.com/i/api/graphql/${API.TweetDetailQueryId}/TweetDetail`;
const url = `https://twitter.com/i/api/graphql/${API.UserByScreenNameQueryId}/UserByScreenName?variables=${encodeURIComponent(variables)}`;
to
const url = `https://x.com/i/api/graphql/${API.UserByScreenNameQueryId}/UserByScreenName?variables=${encodeURIComponent(variables)}`;
basically changing "twitter" to "x", I don't really know what I'm doing but these seem to fix the the video downloads so long as I have "Strict Tracking Protection Fix" enabled.
Damn, this move was to be expected.
I did a quick fix: https://github.com/AlttiRi/twitter-click-and-save/commit/3b53894ba2448d3286ba2da1d9a8d0e5907214f4 Did not test on FF yet.
The bad thing is that the history is hostname (origin
) depended. So, the new hostname — the new history.
It's why I did not added mobile.twitter.com
earlier in // @match
.
It makes sense to add an option to store the history in a userscript manager extension's storage (instead of Localstorage
), in this case it will work OK on multiple origins.
BTW, technically it's possible to extract the LocalStorage
data from the old (https://twitter.com
) origin,
but it's too complicated for a common user, it requires to run a local https server.
Probably, it would simpler to recreate the history from the downloaded files' names. However, it also requires to run an external program (a script) to scan the download/archive folder.
Seems, it should be worked, will check it in some hours for others bugs.
BTW, thanks, that you have reported it here.
Oh boy, I was just thinking I should export my history the other day, oops! Let me see if I can whip up a better revision of the script.
EDIT: For the time being https://twitter.com/i/api/
still exists as a non-redirected url. You can navigate to this page and open twitter-click-and-save's settings and export history there.
EDIT: For the time being
https://twitter.com/i/api/
still exists as a non-redirected url. You can navigate to this page and open twitter-click-and-save's settings and export history there.
Yeah, it's a good solution, but only for Firefox.
In Chrome the response with 403
code does not count as https://twitter.com/
's page.
Chrome navigates to chrome-error://chromewebdata/
where location.origin
is null
.
Fine. Just go to https://twitter.com/x/migrate.
This link does not redirect to x.com
. But only it.
Then export the history in this user script's popup setting.
Then open any x.com page and import/merge the exported .json
file.
EDIT: For the time being
https://twitter.com/i/api/
still exists as a non-redirected url. You can navigate to this page and open twitter-click-and-save's settings and export history there.Yeah, it's a good solution, but only for Firefox. In Chrome the response with
403
code does not count ashttps://twitter.com/
's page. Chrome navigates tochrome-error://chromewebdata/
wherelocation.origin
isnull
.
Ah dang, yeah. I'm having issues getting the history off Kiwi Browser (Chromium based). I have some old tabs up with twitter.com in them, but click and save isn't allowing the popup to be shown, even though the script is active.
EDIT: Eyyy, https://twitter.com/x/migrate
worked a treat!
Suddenly getting intermittent [error] Fallback URLs are failed.
errors when they should be fine? I can't pinpoint the issue but it might be related to the change?
Edit: Example
False alarm. Just needed Strict Tracking Protection Fix
.
Twitter.com is now auto-redirecting to x.com, script doesn't load on x.com breaking functionality.