Bitcoin Forum
May 02, 2024, 11:29:28 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7]  All
  Print  
Author Topic: [Script] Imgur to TalkImg - automatically fix your broken images  (Read 1999 times)
joker_josue
Legendary
*
Offline Offline

Activity: 1652
Merit: 4558


**In BTC since 2013**


View Profile WWW
November 12, 2023, 04:32:41 PM
Merited by TryNinja (1)
 #121

Let's wait for TryNinja just in case. I guess the API key needs to be updated as well. If you use imgbb, you need to edit the API key in the code and enter your own. The API code is already set by default for your site, TalkImg, but it can also be edited. vgy.me surely has unique API codes as well. 

The API code is just for the script to upload to TalkImg.
The script does not use other API codes, it just takes the image link and sends it to TalkImg via API.


Note this explanation:
Imagine that I have images on Imgbb and I want to transfer them to TalkImg, is it possible?
Forgot to reply this one, sorry.

Yes, you can. I've added a imageLinkRegex variable at the top. It currently only matches imgur links ending with png, jpg, jpeg (edit: and gif).

If you want to match ONLY imgbb images, you can use:

Code:
/https:\/\/i\.ibb\.co\/.*?\.(png|jpg|jpeg|gif)/gi

If you want to match BOTH imgbb and imgur images:

Code:
/https:\/\/i\.ibb\.co\/.*?\.(png|jpg|jpeg|gif)|https:\/\/i\.imgur\.com\/.*?\.(png|jpg|jpeg|gif)/gi

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
1714692568
Hero Member
*
Offline Offline

Posts: 1714692568

View Profile Personal Message (Offline)

Ignore
1714692568
Reply with quote  #2

1714692568
Report to moderator
1714692568
Hero Member
*
Offline Offline

Posts: 1714692568

View Profile Personal Message (Offline)

Ignore
1714692568
Reply with quote  #2

1714692568
Report to moderator
1714692568
Hero Member
*
Offline Offline

Posts: 1714692568

View Profile Personal Message (Offline)

Ignore
1714692568
Reply with quote  #2

1714692568
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714692568
Hero Member
*
Offline Offline

Posts: 1714692568

View Profile Personal Message (Offline)

Ignore
1714692568
Reply with quote  #2

1714692568
Report to moderator
1714692568
Hero Member
*
Offline Offline

Posts: 1714692568

View Profile Personal Message (Offline)

Ignore
1714692568
Reply with quote  #2

1714692568
Report to moderator
TryNinja (OP)
Legendary
*
Offline Offline

Activity: 2814
Merit: 6974



View Profile WWW
November 12, 2023, 04:34:38 PM
Merited by LoyceV (6), Pmalek (2), vapourminer (1)
 #122

I was wondering if there is a quick way to add new image hosts to the code? A few years ago, I used vgy.me for images in some of my threads. Perhaps the script could be used to automatically replace those links as well.  
Yes, there is.

joker_josue is correct. The following line is used to grab the images which are then uploaded to talkimg:

Code:
const imageLinkRegex = /https:\/\/i\.imgur\.com\/.*?\.(png|jpg|jpeg|gif)/gi

For vgy.me, you would probably use:

Code:
const imageLinkRegex = /https:\/\/vgy\.me\/.*?\.(png|jpg|jpeg|gif)/gi

Or for both imgur and vgy.me:

Code:
const imageLinkRegex = /https:\/\/vgy\.me\/.*?\.(png|jpg|jpeg|gif)|https:\/\/i\.imgur\.com\/.*?\.(png|jpg|jpeg|gif)/gi

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pmalek
Legendary
*
Offline Offline

Activity: 2758
Merit: 7125



View Profile
November 12, 2023, 06:08:13 PM
 #123

OK, it worked to some degree. The images that are still available and uploaded on vgy.me are now available with a TalkImg link. But it seems that for some reason vgy.me deleted most of the images I uploaded years ago. Those are unfortunately lost now. But that's not something that you can do anything about.

Excellent service, thanks a lot!

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: « 1 2 3 4 5 6 [7]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!