Textpattern CMS support forum

You are not logged in. Register | Login | Help

#51 2009-06-16 22:10:58

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

wow :) great combo with dropbox

Last edited by jelle (2009-06-16 22:11:11)

Offline

#52 2009-07-12 15:21:37

feytus
Member
Registered: 2009-06-02
Posts: 43

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

I tried this a couple of days ago hotlinking to some files on 2shared.com, which all worked great – for two days, when 2shared simply decided to delete the files. So, I moved them all over to archive.org, got the hotlinks, like this; http://www.archive.org/download/marsmelons_records/MMx009_Lesbian.zip and added it in the files-tab. But this doesn’t work for some reason – get a 404 trying to download it – even though I did the exact same thing when I uploaded from 2shared. Any ideas on why?

Here’s the link that should be working; http://www.marsmelons.com/file_download/68/MMx009_Lesbian.zip.link

Last edited by feytus (2009-07-12 19:50:20)

Offline

#53 2009-07-12 19:54:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

feytus wrote:

get a 404 trying to download it

Did you delete the original .link files in the Files tab before adding the new URLs? If you did not do that then you may still be using the old links.

What happens is that each time you add a URL with the same filename at the end of the URL, it is added to a list of similar files. Thus you can host the same file at different providers and the link you are given when you clidk a file_download inTXP is randomly chosen from all the ones you have added. If you did not delete the old one .link, there is a chance that roughly 50% of the time you’ll get a 404 when it tries to serve the (deleted) file from 2shared.com.

The next version of the plugin — which I have in alpha alpha alpha testing (i.e. most of it hasn’t been written!) — actually shows you a list of all the URLs against each file so you can edit them directly, delete them, reorder them, etc. Until that version hits the streets you have a few options:

  1. in your FTP client, navigate to your files directory and download/edit the .link files directly. Open themn in your favourite text editor and delete any old URLs to 2shared.com, then re-upload the .link files, overwriting the original ones
  2. Use smd_file_download_link and add the choose=2 attribute so it forces the plugin to pick the 2nd URL in the list, which should always be your archive.org entry. This overrides the default ‘load balancing’ system that randomly chooses a remote file

Hopefully that will fix it. If none of that is any use, please give me some more details on what you see in a typical .link file (one that gives a 404) and I’ll se if I can diagnose it further.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#54 2009-07-12 20:39:17

feytus
Member
Registered: 2009-06-02
Posts: 43

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Thanks for your reply, man. I tried deleting all the old files now, and am simply using the lesbian.zip (strange example, I know) as test for this. It still doesn’t work though. When accessing the .link file through an FTP client, all the info it holds is the link to the download;

http://www.archive.org/download/marsmelons_records/MMx009_Lesbian.zip

Which does work in itself, just not through your plugin. Very, very strange. And this is the link that should in theory be working;

http://www.marsmelons.com/file_download/69/MMx009_Lesbian.zip.link

Last edited by feytus (2009-07-12 20:40:59)

Offline

#55 2009-07-12 21:02:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

feytus wrote:

It still doesn’t work though.

Freaky.

OK, let’s run a test or two. I can visit this URL: http://www.marsmelons.com/file_download/1 and I receive the file. I assume this is because it is a regular file hosted in your Files dir. The same with 2 and 3. But if I try 4, 5, 6… 69 and so on, I receive 404s for all of them. This implies one of two things:

  1. those entries are not in your database
  2. the plugin is broken (which may cause issue 1!)

So, please check a couple more things. First, have a look in MySQL at the contents of the txp_file table. Do you see entries for IDs 4, 5, 6 and so on? Do they look normal to you?

If you see there are files there, try temporarily disabling smd_remote_file and visit http://www.marsmelons.com/file_download/69. You should be served the .link file directly. If you still get a 404 then there’s a chance the file itself has not been created or it has been created with insufficient permissions. A head scratcher for sure…


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#56 2009-07-12 21:17:42

feytus
Member
Registered: 2009-06-02
Posts: 43

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

There’s entries in the mySQL database for all the files that I still have (there’s a huge gap in files between 3 and 27, I’m not quite sure why, but I think it was because of some plugins I fooled around with earlier, but decided to delete). All the entries look normal, as far as I’m concerned (I don’t know much about MySQL in all honesty), they have a status “4”, and trying the method you used, I can download all the existing files.

I de-activated your plugin, and clicked the 69, and it asked me to download the .link file – so maybe this implies that there’s something wrong with the plugin? Maybe I installed it incorrectly? Not quite sure how I could’ve done that though.

Edit; Don’t know if this clarifies anything, but I tried your plugin using another hotlink, from another server, and it worked fine. This one;
http://www.dump.no/files/1723776c1e87/MMx001_Amor_Fati.zip

So maybe it’s something to do with archive.org? Hotlinking directly from them, through html, works great, doing it as a temporary thing right now.

Last edited by feytus (2009-07-12 21:24:42)

Offline

#57 2009-07-12 21:57:14

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

feytus wrote:

I de-activated your plugin, and clicked the 69, and it asked me to download the .link file – so maybe this implies that there’s something wrong with the plugin?

Definitely. Sounds like it’s something to do with the way it redirects to the remote server or the way it checks to see if the remote file is available before serving. It does a check before downloading it to see if it’s being tricked (e.g. some hosts supply an image file to say ‘file not found’ instead of simply returning a correct 404 status code). It appears that archive.org are doing some additional (302) redirection with their so-called ‘direct’ URLs.

Unfortunately, this is where you need to be a bit of a Sherlock. My usual MO is to fire up the awesome LiveHTTPHeaders extension in Firefox, click a TXP remote link and watch where it’s being redirected. In this case, the link is 404ing before we get anywhere, so I tried the direct link:

http://www.archive.org/download/marsmelons_records/MMx009_Lesbian.zip

Guess what? It is being redirected to:

http://ia301515.us.archive.org/0/items/marsmelons_records/MMx009_Lesbian.zip

My guess is that if you put that 2nd URL in the .link file it’ll work fine. Please try it to prove it. But of course you don’t really wanna be doing that for all your files because it’s a pain in the butt, so smd_remote_file needs to go back to school and learn to take additional server-side redirects into account. I’ll see what I can do, but I can’t promise the solution will be “very soon” unfortunately. Thanks for pointing this bug out.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#58 2009-07-13 09:35:59

feytus
Member
Registered: 2009-06-02
Posts: 43

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Oh yes, that last link you put there is working. :) How did you find that though? I’m willing to go through the trouble to have a counter on my downloads (as my label has just launched, I guess this is the time most people will download stuff). Edit; man, I just got up, missed the part about ‘LiveHTTPHeaders’, I will check that plugin out! Thanks for the tip! And no worries about the bug, it’s a great plugin none the less. :)

Last edited by feytus (2009-07-13 09:38:09)

Offline

#59 2011-01-29 18:00:13

feytus
Member
Registered: 2009-06-02
Posts: 43

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

I am using Textpattern for my netlabel (www.marsmelons.com), but for my two last releases (a mix and an EP), no downloads have been recorded, even though I know people have downloaded them. I am hosting these files on a remote server and integrating them in textpattern with smd_remote_file. Could the problem be on this plugins end, or might there be some error in my textpattern setup?

Everything I have hosted on a remote server before has been counted and working well (and continue to do so), so its a bit strange. Any ideas on what might be wrong? Any help much appreciated. :)

Offline

#60 2011-11-13 18:32:18

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 198
Website

Re: smd_remote_file: Manage remote URL downloads via TXP's Files tab

Hi! Seems like smd_remote_file is not working with TXP 4.4.1 I’ve just installed and I can’t see the input form field in the Files tab.

Regards,

Offline

Board footer

Powered by FluxBB