Pages:
Author

Topic: [Script] Imgur to TalkImg - automatically fix your broken images - page 6. (Read 2052 times)

legendary
Activity: 2758
Merit: 6830
Thanks for this work around.  How do I set a specific folder for these legacy images?
You can now specify the albumId from TalkImg at the top of the script (if you have an account there).

i.e: https://www.talkimg.com/album/XXXX < id



Code:
[60454365] Could not edit post (maybe locked?), deleting uploaded images...
This won't stop the script, so you can ignore it. Or maybe you're still getting the long "Cross-Origin Request Blocked" message everytime it tries to delete the image from TalkImg?
legendary
Activity: 2702
Merit: 2645
Farewell LEO: o_e_l_e_o
I got error
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://talkimg.com/image/UUGNf/delete/eb7edff665a1505b793b77cfb76374db770c993d2420a8d6. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
It's an error with TalkImg, maybe load related (or joker_josue is trying to fix CORS while we're talking, which would make the script work without my proxy).

I was able to skip the error and rerun the script.

Most possibly when it finds a topic which is locked then from the next step it stops working and shows error.

In my case the error was on the 33rd page [const startPage = 33]
Then I thought to skip the page and started from 34th page [const startPage = 34]


It worked until I got the same error on 78th page.
Code:
[60454365] Uploading image... debugger eval code:138:25
[60454365] Uploaded: https://talkimg.com/images/2023/05/14/blob55aa087fccffd7d7.jpeg debugger eval code:143:29
[60454365] Editing post https://bitcointalk.org/index.php?topic=5404157.msg60454365#msg60454365 debugger eval code:156:25
[60454365] Could not edit post (maybe locked?), deleting uploaded images...
Again skipped the error page and started from 79th page [const startPage = 79]

It's working.

Hopefully it will help for those who are seeing error after running the script for a few minutes.

[edit]
This is my current status
Quote
Getting posts on page 136/465 (29%)


legendary
Activity: 1604
Merit: 1564
精神分析的爸
Imgur to TalkImg - automatically fix your broken images



Thank you very much for your effort, worked like a charm.
legendary
Activity: 2758
Merit: 6830
I don't know if I misunderstood the script here. My question here is that, you are saying we should re-uploads the uploaded images from the imgur links and to talkimg. com but what about the images that are not the device, can they be found? Because the issue now is the images that are not in the hard drive.
The script grabs the images from the forum and reuploads them on TalkImg.

I got error
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://talkimg.com/image/UUGNf/delete/eb7edff665a1505b793b77cfb76374db770c993d2420a8d6. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
It's an error with TalkImg, maybe load related (or joker_josue is trying to fix CORS while we're talking, which would make the script work without my proxy).
legendary
Activity: 2702
Merit: 2645
Farewell LEO: o_e_l_e_o
@TryNinja, please check edit of my last post if you missed it already.

[edit]
I got error
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://talkimg.com/image/UUGNf/delete/eb7edff665a1505b793b77cfb76374db770c993d2420a8d6. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
The learn more link: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin?utm_source=devtools&utm_medium=firefox-cors-errors&utm_campaign=default

Followed by the following
Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.
Code:
 debugger eval code:172
    AsyncFunctionNext self-hosted:810
    (Async: async)
     debugger eval code:172
    getEvalResult resource://devtools/server/actors/webconsole/eval-with-debugger.js:251
    evalWithDebugger resource://devtools/server/actors/webconsole/eval-with-debugger.js:172
    evaluateJS resource://devtools/server/actors/webconsole.js:960
    evaluateJSAsync resource://devtools/server/actors/webconsole.js:851
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
hero member
Activity: 854
Merit: 1246
1. Goes through all your posts looking for imgur.com direct links (.png|.jpg|.jpeg);
2. Reuploads the image to talkimg.com;
3. Edits the post with the new link.

I don't know if I misunderstood the script here. My question here is that, you are saying we should re-uploads the uploaded images from the imgur links and to talkimg. com but what about the images that are not the device, can they be found? Because the issue now is the images that are not in the hard drive.

Quote
How to use it:

1. Go to bitcointalk.org (any page).
2. Open the browser developer tools on the Console tab (Ctrl+Shift+I or F12).
3. Paste the script and press Enter.
4. Leave the page open while the script runs and, if you can, do not use the forum (not even in other tabs) to avoid rate limiting errors
And the above can only work in computer and not in Android.
legendary
Activity: 2702
Merit: 2645
Farewell LEO: o_e_l_e_o
465 is the number of images I posted so far on the forum using imgur?
If feels like not even close to what I think the real number should be out of 9815 total posts LOL
It's the number of pages you have on your post history (minus ignored boards, maybe? because I see you actually have 491 pages).

Could you check how many pages you see? https://bitcointalksearch.org/user/bitcoingirlclub-662330
I get caught on the ignore boards in many occasions so far. Yes I have many boards are on ignored and with ignored boards total number of pages are 465. When I am checking it from none logged in browser then I see it's 491. I don't care about the ignored boards though LOL

Thanks for clarification. I was thinking those were number of images.

[edit]
I got error
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://talkimg.com/image/UUGNf/delete/eb7edff665a1505b793b77cfb76374db770c993d2420a8d6. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
The learn more link: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin?utm_source=devtools&utm_medium=firefox-cors-errors&utm_campaign=default

Followed by the following
Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.
Code:
 debugger eval code:172
    AsyncFunctionNext self-hosted:810
    (Async: async)
     debugger eval code:172
    getEvalResult resource://devtools/server/actors/webconsole/eval-with-debugger.js:251
    evalWithDebugger resource://devtools/server/actors/webconsole/eval-with-debugger.js:172
    evaluateJS resource://devtools/server/actors/webconsole.js:960
    evaluateJSAsync resource://devtools/server/actors/webconsole.js:851
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
legendary
Activity: 2758
Merit: 6830
465 is the number of images I posted so far on the forum using imgur?
If feels like not even close to what I think the real number should be out of 9815 total posts LOL
It's the number of pages you have on your post history (minus ignored boards, maybe? because I see you actually have 491 pages).

Could you check how many pages you see? https://bitcointalksearch.org/user/bitcoingirlclub-662330
legendary
Activity: 2702
Merit: 2645
Farewell LEO: o_e_l_e_o
I am on Firefox using the TOR connection. But interestingly I can not copy and paste the code even anything to my console. What is the mystery?
You need to type "allow pasting" on the Console (notice the alert under the Console tab).
It's working!!!



465 is the number of images I posted so far on the forum using imgur?
If feels like not even close to what I think the real number should be out of 9815 total posts LOL
legendary
Activity: 2758
Merit: 6830
I've seen in the script a part that writes "https://bitcointalksearch.org/user/tryninja-557798", which is TryNinja's profile.
The next line is fetching data from there. So yeah, I guess that everybody is trying to copy TryNinja's images  Wink
Yes, forgot to remove my uid from the URL. Tongue

It should work now.

PS. Does this also cover the parts of the forum I've posted in the past and now I have them ignored?
I'm not sure. Only if they show up on your post history.

edit: ignored boards don't show up, so they aren't covered.

Can we make the process less automatic for members who prefer to manually edit their old posts? I had an idea that you or LoyceV might be able to assist with. For instance, adding a search function for posts with images or Imgur links to ninjastic.space would make it easier for members to manually locate and edit their old posts without relying on an automated script. This could be an additional parameter in the search settings that only displays posts with images. Do you think this would be possible?
Sure, I'll see what I can do.

I am on Firefox using the TOR connection. But interestingly I can not copy and paste the code even anything to my console. What is the mystery?
You need to type "allow pasting" on the Console (notice the alert under the Console tab).



I also decreased the limit from 30 uploads/minute to 20 uploads/minute to hopefully get a lower load on @joker_josue's server.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
I will come back to the error I've noticed.
I've seen in the script a part that writes "https://bitcointalksearch.org/user/tryninja-557798", which is TryNinja's profile.
The next line is fetching data from there. So yeah, I guess that everybody is trying to copy TryNinja's images  Wink

PS. After changing in the script his user id with mine I stopped getting that error.
hero member
Activity: 2464
Merit: 934
For those who want to run this script on android device can use Eruda browser to do so. Click three dot browser at top right >> run code >> paste script in console.

https://www.talkimg.com/ss.png
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
I didn't look into the script, I just tried to run it by the instructions.
Well... I've got errors like the one from the linked image and... the posts to be edited seem to be TryNinja's Cheesy Cheesy

I guess that it still needs a little work, however, I do like the idea and I appreciate the effort (hence the merit).

PS. Does this also cover the parts of the forum I've posted in the past and now I have them ignored?

legendary
Activity: 3668
Merit: 2218
💲🏎️💨🚓
There's already an embedded API key so you don't need to use your own. hOWEVER  if you have contacted Joker to ask to register, then you can get an API key in the settings section.
hero member
Activity: 2674
Merit: 713
Nothing lasts forever
Thanks for this work around.  How do I set a specific folder for these legacy images?

I decided to go ahead and get things started.  I swapped out the API for the one I have on my account.  After 185 pages without any activity, this happened:



...and the script stopped.

How did you get the API key ?

I tried to search for it on the site and even tried to register but couldn't see any options for it anywhere on the site.
I tried running the script in OP but it didn't change any of the images although the script completed without any errors.
So I thought of registering on the site and using it's API and then try running the script.
legendary
Activity: 1638
Merit: 4508
**In BTC since 2013**
Did you make talkimg.com server busy?



I am assuming a lot of data are now uploading by the script to their server and it's like a ddos attack for them LOL

Incidentally, not so many images have entered since the script was published that could cause this.

Either way, with so many requests, there may be moments of instability. But for now it continues to work normally.





Thanks again to TryNinja for this script, which will certainly be of help.

But, I also ask for understanding for the fact that I had planned a gradual growth, and not a sudden growth due to a similar service going out of business.  Roll Eyes
Believe me, I've been making every effort to keep things running, and I'm already planning to reorganize the server.

So far I've managed to keep everything working. Therefore, I appreciate your understanding if there are moments of instability (which I believe were very rare).  Wink

legendary
Activity: 3668
Merit: 2218
💲🏎️💨🚓
Thanks for this work around.  How do I set a specific folder for these legacy images?

I decided to go ahead and get things started.  I swapped out the API for the one I have on my account.  After 185 pages without any activity, this happened:



...and the script stopped.
legendary
Activity: 1512
Merit: 4795
I am assuming a lot of data are now uploading by the script to their server and it's like a ddos attack for them LOL
I have just uploaded an image twice on the site and it is working fine. Upload another image because maybe the image you wanted to upload is not of supported format.
legendary
Activity: 2702
Merit: 2645
Farewell LEO: o_e_l_e_o
Did you make talkimg.com server busy?



I am assuming a lot of data are now uploading by the script to their server and it's like a ddos attack for them LOL


Script:



I am on Firefox using the TOR connection. But interestingly I can not copy and paste the code even anything to my console. What is the mystery?
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Can we make the process less automatic for members who prefer to manually edit their old posts? I had an idea that you or LoyceV might be able to assist with. For instance, adding a search function for posts with images or Imgur links to ninjastic.space would make it easier for members to manually locate and edit their old posts without relying on an automated script.
To add to this feature request: I've downloaded 796k images from imgur so far (and I'm almost done with all images from my archived posts). I could create one zip-file per userID with all their images. All you'd have to do is find the name given by imgur. I can probably make a list of posts too, but I think TryNinja can do that much faster (and on demand).
Pages:
Jump to: