# btdownloadcurses.py fails with Suprnova.org's new policy

## amiatrome

I do all my BT downloading with btdownloadcurses.py and screen.

```
alias bt="btdownloadcurses.py --ip amiatrome.dyndns.org --minport 6881 --maxport 6885 --min_uploads 10 --max_upload_rate 20 --url "
```

```
arnold@arbitrage bittorrent $ bt '<url_to_torrent_file>'
```

However, I have been getting a lot of 'bad file info' errors recently. I finally found out why.

 *Quote:*   

> Hotlinking	sloncek @ 18-09-2004 16:25
> 
> As some of you might have noticed, SuprNova.org had some problems recently regarding its servers and .torrent download. It turned out that some of the (unauthorized) third party programs and/or sites that are hotlinking to our torrent database was poorly designed/configured, and that almost killed SuprNova servers. So we had no choice but to enable .torrent access only to users coming from our official mirrors. This policy will not change, so don't ask.  In case you have misconfigured browser, you'll get (instead of .torrent) .html file with instructions how to configure your computer to access our .torrents.
> 
> I hope you understand our position and we ask you again, not to use third party applications / sites to access SuprNova.org!
> ...

 

Here's what the .html says.

 *Quote:*   

> Unauthorized download
> 
> We're sorry, but this downlod request cannot be authorized. There could be several reasons for this:
> 
> 1) You clicked on a link on an *unofficial* SuprNova.org mirror. We do not allow that kind of external hotlinking. This site creates a great deal of traffic and it's hard to find a good hosting. We will not provide the bandwith for other sites. Please visit SuprNova.org and you can download all the torrents you want.
> ...

 

I have tried using wget to download the .torrent but I still get the .html instead.

```
wget --referer='http://www.suprnova.org' "<url_to_torrent_file>"
```

It's really late over here and my lights just gave up on me. My only light source is the monitor I am staring at.   :Shocked:  So I am inclined to go to sleep instead and leave the problem for tomorrow. Just thought I would post this since its possible some of you would be wondering about the 'bad file info' error. And hopefully, already have a CLI solution. That would really brighten up my morning!   :Cool: 

PS. for those of you who are wondering why am I not using <insert_suprnova_recognized_browser> etc to download the .torrent, it's mainly because I usually ssh back from campus back home to start new downloads. I do that with giFTcurs too.   :Very Happy: 

----------

## Eskarel

Your problem is that suprnova.org isn't the actual mirror it just assigns you one, if you can find out one of the mirrors actual addy's you can probably fake it.

----------

## fls

Hm, is it an option for you to download the .torrent with your webrowser, save it on the harddisk and then run your bt command with "--responsefile <torrentfile>" instead of "--url <link>"?

----------

## amiatrome

The referer url can be found by right-clicking the torrent frame and opening it in a new window.

```
http://69.50.168.139/sn2//list_news.html
```

Anyway, I wrote a short script to make it easier to download .torrent using wget.

```
wb torrent_url [referer_url]
```

It saves the referer url so you don't need to reenter it unless there is a need to.

```
#!/bin/bash

MIN_PARMS=1

if [ $# -lt $MIN_PARMS ]         # check for \# of parameters

then

   echo "wb torrent_url [referer url]"

   exit 0

fi

REF_FILE=referer            # location of referer file

if [ "$#" -eq "1" ]

then

   { read REF_URL            # use previous referer url

   } < $REF_FILE

   wget --referer="$REF_URL" "$1"      # download .torrent

else

   wget --referer="$2" "$1"      # use user-specified referer url, download .torrent

   { echo $2

   } > $REF_FILE            # save referer url

fi

exit 0
```

----------

## GReaper

Save the .torrent file:

wget torrentfile

btdownloadcurses.py ... --responsefile torrentfile

----------

## amiatrome

 *GReaper wrote:*   

> Save the .torrent file:
> 
> wget torrentfile
> 
> btdownloadcurses.py ... --responsefile torrentfile

 

This method will not work because of suprnova's new policy. Pls read my first post carefully.

----------

## GReaper

Try links/lynx to navigate suprnova and download the .torrent then...

----------

## amiatrome

 *GReaper wrote:*   

> Save the .torrent file:
> 
> wget torrentfile
> 
> btdownloadcurses.py ... --responsefile torrentfile
> ...

 

You obviously have not even tried any of the things you have suggested. Because if you had, you would know that none of them work.

Even if they do, the script I have up there works. Getting the .torrent in a terminal can't get any easier than this.

```
wb 'paste_torrent_url'
```

or the occasional

```
wb 'paste_torrent_url' 'paste_referer_url'
```

----------

## GReaper

The links solution could work, if suprnova's site wasn't filled with javascript.  :Razz:  (Which I didn't check!)

----------

## OdinsDream

Maybe this is just too simple to be a solution, but when I noticed that I couldn't wget the torrents any longer without figuring out the proper referer header, I just right-clicked the torrent on the webpage and saved it that way.

This worked for me, is it not for you? Or are you just wanting to get wget working again.

If you right-click the webpage and choose View Page Info (assuming firefox here) then you can get the actual URL of the site/mirror you're using (it's probably not suprnova.org, as mentioned in a previous post)

It is that URL that you'll need to pass to wget with the --referer= option. That should get it working for you.

----------

## amiatrome

I needed a command-line solution because I ssh from campus back home to start downloads.

Sometimes, its from a windows box in the library. Which is exactly what I am typing this message on now. Having a CL way really simplifies things a lot. Check it out. Straight from putty!

```

| file:     ____.avi

| size:     734,230,528 (700 MiB)

| dest:     /mnt/main/bittorrent/____.avi

| progress: ###

----------

## tragor

Sorry that I cannot help you.

But I have a question: What client do you use? I use the original one, but it does not display the number of seeds and stuff...

Greets,

tragor

PS: Just a thought: You could download the torrents locally and then copy them to your computer at home using winscp or something... Not that simple, but would work...

----------

## OdinsDream

 *amiatrome wrote:*   

> I needed a command-line solution because I ssh from campus back home to start downloads.
> 
> Sometimes, its from a windows box in the library. Which is exactly what I am typing this message on now. Having a CL way really simplifies things a lot. Check it out. Straight from putty!
> 
> ```
> ...

 

Same here. I couldn't live without the cli version. I downloaded the file locally and used winscp2 to transfer it over to my home system, then begin the download. I see what your problem is, though. Definitely look into the Page Info. I'm sure once you get the right referer (it should be the URL of the bittorrent file, minus the torrent filename) wget should have you handled.

----------

## amiatrome

Not sure if you guys noticed, but I had already solved my problem in my 2nd post. And the 5th post was a sign that life was back to normal for me.   :Wink: 

 *tragor wrote:*   

> Sorry that I cannot help you.
> 
> But I have a question: What client do you use? I use the original one, but it does not display the number of seeds and stuff....

 

Well I use btdownloadcurses.py(and screen). I believe its part of the original client. So you should have it too. Type 'btdownloadcurses.py' for usage options. You can see how it looks like from previous posts.

 *OdinsDream wrote:*   

> I downloaded the file locally and used winscp2 to transfer it over to my home system, then begin the download.

 

You could give my script a go. I run it on my remote box. It could save you a small amount of keystrokes. It's no work of art but its approach works pretty well. Havent had to reenter the referer url since my 2nd post.

[edited some mistakes...]

----------

## tragor

As I said before: I use already the original btdownloadcurses.py (with screen) from BitTorrent-3.4.2. Very nice! But I would like to have some more information about the torrent I am downloading, namely the number of seeds and downloaders so that I know wether it is worth downloading or not. Would be nice, if you could tell me your clients name  :Smile:  !

Thx,

tragor

----------

## amiatrome

 *tragor wrote:*   

> As I said before: I use already the original btdownloadcurses.py (with screen) from BitTorrent-3.4.2. Very nice! But I would like to have some more information about the torrent I am downloading, namely the number of seeds and downloaders so that I know wether it is worth downloading or not. Would be nice, if you could tell me your clients name  !
> 
> Thx,
> 
> tragor

 

```
| file:     ____.avi

| size:     734,230,528 (700 MiB)

| dest:     /mnt/main/bittorrent/____.avi

| progress: ###

----------

## tragor

Yes thanks a lot!

As I can see

BitTornado (http://bittornado.com/)

and the original client (http://bittorrent.com/)

have the same basic features with BitTornado having some additional functionality.

I think I will try BitTornado then - a pity that I have to unmerge the official client though.

----------

## solarium_rider

I created a patch to BitTorrent to allow you to pass a --referer command line option.

http://www.divinia.com/people/ccase/BitTorrent-3.4.2-referer.patch

Example of usage:

```
btdownloadcurses.py --referer "http://www.suprnova.org/" --url "<copy and paste from website>"

```

Note: the trailing slash on the referer is needed.[/code]

----------

