Pages:
Author

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

hero member
Activity: 2520
Merit: 952
I'm getting this error.



legendary
Activity: 2296
Merit: 2892
#SWGT CERTIK Audited
All BBCode is visible on the post. Usually, it appears when the post is still being edited.
Sorry, that was my bad. I was trying to fix the emojis and broke the bbcodes for a moment. Fixed just a moment later but you were one of the victims. :P

Here is yet another script that should fix your posts with broken bbcode: https://gist.github.com/ninjastic/d560848568339e5a2d7a25ddffb578d5

All it does is find those posts and refresh them (a.k.a edit without any change).
Thanks, TryNinja, for the script to fix the broken post.
Previously, I thought Bitcointalk needed time to refresh the display of posts, as when changing avatars, which sometimes took several minutes.

But after a day has passed, it still hasn't been updated. I had time to edit (without any changes) manually on several posts that I found were broken.
legendary
Activity: 2758
Merit: 6830
All BBCode is visible on the post. Usually, it appears when the post is still being edited.
Sorry, that was my bad. I was trying to fix the emojis and broke the bbcodes for a moment. Fixed just a moment later but you were one of the victims. Tongue

Here is yet another script that should fix your posts with broken bbcode: https://gist.github.com/ninjastic/d560848568339e5a2d7a25ddffb578d5

All it does is find those posts and refresh them (a.k.a edit without any change).
legendary
Activity: 2296
Merit: 2892
#SWGT CERTIK Audited
One of the bugs that I encountered in several posts, as shown in the following screenshot:



Post links: https://bitcointalksearch.org/topic/m.52918008

All BBCode is visible on the post. Usually, it appears when the post is still being edited.


Earlier, I tried to edit a post similar to that manually and immediately saved it again without making any changes to the content and code of the post, for example, this post:
[Edukasi] Privasi dan Anonimitas Bitcoin
legendary
Activity: 1862
Merit: 5154
**In BTC since 2013**
"Single Topic" version

Get the code here: https://gist.github.com/ninjastic/59bde80306c32153a5775b9a570b16b7

Run it on any topic and all images posted by you will be updated.

IMPORTANT: only images that are shown on the screen! This means that if you are on page 1, the script won't update the images on page 2. You can use the ;all page on the forum to make all posts show up all at once (probably won't work properly if the topic is huge?).

Does it only work if the images are on Imgur?
Imagine that I have images on Imgbb and I want to transfer them to TalkImg, is it possible?
legendary
Activity: 2758
Merit: 6830
"Single Topic" version

Get the code here: https://gist.github.com/ninjastic/59bde80306c32153a5775b9a570b16b7

Run it on any topic and all images posted by you will be updated.

IMPORTANT: only images that are shown on the screen! This means that if you are on page 1, the script won't update the images on page 2. You can use the ;all page on the forum to make all posts show up all at once (probably won't work properly if the topic is huge?).



not all imgur images/links have not been converted into imgbb images/links.
when i open the thread the new imgbb images are shown to me and the rest (old imgur images) are not
Try the above script.

cc @Royse777
legendary
Activity: 3304
Merit: 8633
icarus-cards.eu
i have now also run the script overnight and the whole procedure was completed properly. however, i have the following problem in one of my threads ([INFO] CCC - cygan's crypto collection - constantly updated), that not all imgur images/links have not been converted into imgbb images/links.
when i open the thread the new imgbb images are shown to me and the rest (old imgur images) are not

anyone a solution how i can update this again using this script?
legendary
Activity: 2758
Merit: 6830
I am worried about the emojis, Many times I used these emojis in my post. They will look strange now. Please try to do something so that it gets auto-fixed.
Thank you! My biggest concern was making sure posts and titles don't get messed up, but I totally forgot to test some emojis (very complicated to deal with...). Tongue Sad

It should be fixed now.

Another issue is the script is counting an emoji ex. (Smiley) as a photo.
It was an encoding issue, actually. Emojes can be a bit complicated but I found a solution.
donator
Activity: 4760
Merit: 4323
Leading Crypto Sports Betting & Casino Platform
I haven’t had a chance to check this out yet as I am just stumbling upon it, but it seems like a great tool to keep the integrity of older posts.

My immediate thoughts are if this could be run with Administrator privileges forum wide so that all images could be corrected for everyone at once. I don’t know if TalkImg would even want that, but it would be cool. 
legendary
Activity: 2436
Merit: 1189
Need Campaign Manager?PM on telegram @sujonali1819
Thank you for your awesome work. It's incredible. I have tried to use the script today. Here are some issues that I face.

I got an error like File is larger than 2mb or something like this. I forget to take a screenshot. But it's sure the photos were not more than 2mb since the forum does not support it.

Another issue is the script is counting an emoji ex. (Smiley) as a photo. and it also tries to change it. That means if you use any emoji in your title or in the post it will be changed with some unreadable characters.

See here my title has changed:



What was like this:




I am worried about the emojis, Many times I used these emojis in my post. They will look strange now. Please try to do something so that it gets auto-fixed.



legendary
Activity: 2464
Merit: 3878
Hire Bitcointalk Camp. Manager @ r7promotions.com
Possible to have another script only for single thread, reply etc?

The locked threads are not updating, I have many of them. The script will help to update individual threads when browsing the threads in the future.
legendary
Activity: 1862
Merit: 5154
**In BTC since 2013**
So I guess it won't be possible on imgbb since we don't have anyone from server side to allow the above configuration.
May be joker_josue can help in here to increase the max limit size for the uploads or provide specific endpoint which allow increased max limit size to specific users.

I've been having trouble configuring CORS, but working on it.
That's why TryNinja has implemented a proxy that helps. We have to wait for him to see if the last changes I made will work.
hero member
Activity: 2702
Merit: 716
Nothing lasts forever

snip


Of course, I set the parameters correctly with a freshly generated API from a new account.

I finished uploading every possible image to talkimg, only a few left above the 2MB threshold, so I wanted to have a second round with imgbb.

Apparently still the uploading error I had the other day

Code:
[Error] Origin https://bitcointalk.org is not allowed by Access-Control-Allow-Origin. Status code: 502


Error 502 means that there's an error from the server side. When I digged up I found that we get this error when appropriate CORS (Cross-Origin Resource Sharing) headers are not set on the domain.
So the API request in the above script is being blocked by the browser and there are only two solutions for this.

1. The server side configuration has the appropriate CORS headers set and allows requests from bitcointalk
2. Get a proxy or server side endpoint which allows us to bypass CORS restrictions

So I guess it won't be possible on imgbb since we don't have anyone from server side to allow the above configuration.
May be joker_josue can help in here to increase the max limit size for the uploads or provide specific endpoint which allow increased max limit size to specific users.
legendary
Activity: 2380
Merit: 17063
Fully fledged Merit Cycler - Golden Feather 22-23

Code:
    
    // options
    const startPage = 1
    const provider = 'talkimg'



Of course, I set the parameters correctly with a freshly generated API from a new account.

I finished uploading every possible image to talkimg, only a few left above the 2MB threshold, so I wanted to have a second round with imgbb.

Apparently still the uploading error I had the other day

Code:
[Log] [59506339] Uploading image...

[Error] Origin https://bitcointalk.org is not allowed by Access-Control-Allow-Origin. Status code: 502

[Error] Fetch API cannot load https://api.imgbb.com/1/upload?key=myotherapi due to access control checks.

[Error] Failed to load resource: Origin https://bitcointalk.org is not allowed by Access-Control-Allow-Origin. Status code: 502 (upload, line 0)

[Error] Unhandled Promise Rejection: TypeError: Load failed


legendary
Activity: 2800
Merit: 2736
Farewell LEO: o_e_l_e_o
I would also like to share here the latest update about the TalkImg.com server update process
Looking forward to it. Good luck brother.

@TryNinja, finally it's all done!



Hell! It's a lot of work that was done by the script. 10K plus posts! Quite an achievement to be honest.

just i am curios, time for do this?
10k posts is so much Cheesy

anyway is a great job about talkimg owner and about tryninja
fillippone have a crisis when imgur decide to delete all images and Smiley this save the day

when i have merits i distribute to talkimg owner and tryninja Cheesy

I have done 25% of the job in 4 hours.
Waiting for talkimg to resume uploads, as I hit some kind of threshold on imgbb and I cannot upload there anymore.
I don't know how long it took but I was online yesterday for around 5 to 6 hours and the script was running while my laptop was on. So more or less it took similar amount of time for me yesterday.

The day before yesterday I was online for few hours and until the update was taking place by joker_josue my system was busy. All together I would say it took 8 to 10 hours to finish the whole update.
copper member
Activity: 1526
Merit: 2890
Excellent work TryNinja I love the bitcointalk community how they come to rescue every time Smiley

I test run it on my few posts and it worked fine. Will run it on all my posts later, probably tonight Smiley

Again big thanks to joker_josue too.
legendary
Activity: 3696
Merit: 4343
The hacker spirit breaks any spell
~
I just updated the script. Now it checks if the topic is locked before uploading any image, which should drastically lower the chances of this error happening.


nice job man
what do you think about my ideas/proposals?
- enable edit view with flag true/false
- permit to change name (we need this option on talkimg) for mantain similar hashname from xx provider to talkimg

i think are good ideas
legendary
Activity: 2758
Merit: 6830
~
I just updated the script. Now it checks if the topic is locked before uploading any image, which should drastically lower the chances of this error happening.
hero member
Activity: 2702
Merit: 716
Nothing lasts forever
I get the same error messages after a half dozen pages:

A new error with imgbb.

May be because you are using imgbb to upload the images. I just completed all my uploads using the script and it was flawless.
I changed the providers to talkimg and then started uploading and in few minutes it was done.

Code:
    
    // options
    const startPage = 1
    const provider = 'talkimg'

legendary
Activity: 3696
Merit: 2219
💲🏎️💨🚓
I've used the original script and the latest script as well as changing the API key to my own.

I get the same error messages after a half dozen pages:

Code:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://talkimg.com/image/agViw/delete/b8ed615e3cd6fbceb9dad6a9cda04996745632ff99b5b22a. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource. debugger eval code:237:13

I jump to the next page and start again and another half dozen or so pages, I get the same error message.

I'm sloooowly going through my pages (am up to 25% of the way through) but it is teedious to have to sit with the script and restart it every few minutes.
Pages:
Jump to: