hicklemr / rtgui

Automatically exported from code.google.com/p/rtgui
0 stars 1 forks source link

Not an issue, added cookie feature #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
After using wTorrent I liked the cookie feature for downloading torrent
files, but I liked rtgui's interface more. So I just added the feature.

I just used a text file as I didn't want to have to add a whole database or
anything. The code isn't great, permissions are problem if some directories
aren't writable. I used curl to download the torrent with the cookie and
moved it to the watched directory. I added the interface to add and delete
cookies in the settings page, it isn't pretty, but works.

This would be a nice little feature in the next version, not hard to do at
all. Most likely don't want to use my code as it sucks :P Attached are my
control.php and settings.php

Original issue reported on code.google.com by nate.wheeler on 25 May 2008 at 6:08

Attachments:

GoogleCodeExporter commented 8 years ago
Please could you explain what this cookie download feature is?

Thanks :)

Original comment by lemonbe...@gmail.com on 26 May 2008 at 6:06

GoogleCodeExporter commented 8 years ago
I use it for the "Add URL" feature to download torrents from private torrent 
sites.
The private sites require a login so unless you have the cookie it won't 
download
from that site.

Example cookie: 

host - www.torrentbytes.net
value - uid=11111;passwd=11111aaaaaa22222222

Original comment by nate.wheeler on 26 May 2008 at 6:44

GoogleCodeExporter commented 8 years ago
Ah, now I understand :)

Agree this will be a very useful feature, and will incorporate it into next 
version...

Thanks for supplying the code.

-Simon.

Original comment by lemonbe...@gmail.com on 26 May 2008 at 7:48

GoogleCodeExporter commented 8 years ago
Hi
I've been looking at incorporating this code, but there's one problem:- the 
curl 
dependency.

Anyone like to comment on methods of downloading using stored cookie values 
without 
using the curl library?

I feel rtGui is already quite heavy on requirments, and don't wish to add any 
more.  
That's the reason why so far I've avoided storing information in mySQL 
databases, 
etc.

Original comment by lemonbe...@gmail.com on 10 Jun 2008 at 9:16

GoogleCodeExporter commented 8 years ago
Very useful feaure, thanks

Original comment by dymofo on 11 Jun 2008 at 6:44

GoogleCodeExporter commented 8 years ago
This will just download the torrent and write it to a file. Its very simple 
example,
but works.

$params = array('http' => array(
                  'method' => 'GET',
                  'header' => "Cookie: uid=123456; pass=1111112222222233333333;\r\n"
               ));
$context = stream_context_create($params);
$url = "https://www.example.com/file.torrent";
$contents = file_get_contents($url, false, $context);
$torrent = fopen("/watch-torrents/" . md5($url) . ".torrent", "w");
fwrite($torrent, $contents);
fclose($torrent);

Original comment by nate.wheeler on 14 Jun 2008 at 10:15

GoogleCodeExporter commented 8 years ago

Original comment by lemonbe...@gmail.com on 5 Dec 2008 at 10:29