Using GeneralURL to get card images from Google Drive

Started by clutchonline, September 16, 2019, 07:35:32 PM

Previous topic - Next topic

clutchonline

Hey it's me again with another question. What I want to know is, if I turn on link sharing for a google drive folder, and then use CardGeneralURLs to link to the folder online in Drive, if that folder has several subfolders (one for each set), will card images be able to update?

Here's the link by the way

https://drive.google.com/drive/u/4/folders/1_JOLgjDGFUSOInGLzWNC5eKWq94fF0y6

CrazyChucky

#1
CardGeneralURLs can work just fine with subfolders?that's how the Magic plugin does it. The general URL is http://magicplugin.normalitycomics.com/cardimages/, and each individual card then has an imageFile field like "mma/37". Lackey then downloads http://magicplugin.normalitycomics.com/cardimages/mma/37.jpg; the only weird part is that it saves it to setimages/mma/mma/37.jpg, since it treats the imageFile field like the file name to save within the set folder. But it loads just fine, and users who don't go mucking about in the plugin files will never even notice.

However, I'm not sure Google Drive is going to be as clean a solution for this as one might hope. Ideally you'd be able to give the Aaron Loup card in Lackey the image name "aaronloup.png". Lackey will append that and the set name to your CardGeneralURL and try to access a file at https://drive.google.com/open?id=1_JOLgjDGFUSOInGLzWNC5eKWq94fF0y6/2019S2/aaronloup.png. But if you try that link, it doesn't work.

The actual shareable link for that card is https://drive.google.com/open?id=1MltxhcT76ht--G5FrhAhroKq_RT6Ysr0. (Although that opens it in Google Drive; to access the image itself, you need to change the URL to https://drive.google.com/uc?export=view&id=1MltxhcT76ht--G5FrhAhroKq_RT6Ysr0.) You would need to set "https://drive.google.com/uc?export=view&id=" as the CardGeneralURL, and then save the ID string in the ImageFile field of each card.

Thankfully, there is a way to automate this instead of clicking on each individual card and separately pasting it: see this StackExchange question. From there, you could do a search-and-replace to eliminate everything but the IDs, and paste it into your card data spreadsheet or whatever you're using to build your data files.

clutchonline

#2
Do you know a better hosting option than Google Drive? I'm in no way tied to google. My carddata.txt file by the way references the names of the actual files ( so aaronloup.png), and has set as 2018S1 for that card.

CrazyChucky

I use Namecheap for both my domain registration and my hosting. It comes out to like... maybe $3 a month or so? And then you have an actual, legit webhost with no hacks or workarounds.

xdarkgeox

amazon aws is also a good place to host https://aws.amazon.com/ its free however if you choose to use it you have download s3 bowser so you can upload many files at once.

IceshadeComets

Untrue, after a year aws costs a small amount, for me with over 20000 images it's around 0.57 cents a month

xdarkgeox

you right but if you hosting not that many files its basically have no cost. its cheap af nevertheless

IceshadeComets

In that case, yes I agree with you it's very cheap.