adriengibrat / torrent-rw

php5 class to read and write .torrent files
GNU General Public License v3.0
320 stars 104 forks source link

Unable to retrive contents of torrent containing many files #28

Closed prateekkathal closed 8 years ago

prateekkathal commented 8 years ago

Hello,

First of all, Thank You for this amazing Library/Package!

I am facing some issue getting the list of torrents containing almost 40-50 files. Let's say I have a torrent file containing more than 50 files in this manner

The content() function return an empty Array in this case.

Can you please look into it once?

Thanks,

adriengibrat commented 8 years ago

seems related to #22

adriengibrat commented 8 years ago

should be fixed by 404232d, keep me posted if it works well, i'm not using or actively maintaining this lib...

prateekkathal commented 8 years ago

Thanks for working on it... But the problem still seems to exist

After doing $this->torrent->content() I still get an empty array.

I did print_r() and the I got this Array()

adriengibrat commented 8 years ago

please provide the torrent file, and the code you used to read its content

adriengibrat commented 8 years ago

please be sure the torrent file was correctly generated, the bug fixed was about creating torrent, i'm pretty sure there is no issue when reading torrent content...

prateekkathal commented 8 years ago

Hello,

Sry for the late reply. When I first reported this issue, I was talking about the reading part only. I am currently using your library to read torrents file only.

I have attached 2 torrent files. Please have a look at them and let me know.

I am running your code in CodeIgniter and everything seems to work perfectly fine, except for the part where I have folders inside folders

Following is the function I am using to get the contents from a torrent file.

function get_torrent_content($torrent_path) {
    $torrent = new Torrent($torrent_path);
    return $torrent->content();
}

Torrents.zip

Let me know. Thanks for the great support :)

adriengibrat commented 8 years ago

I can't reproduce any pb with the provided torrent files: my test file:

<?php
require_once 'Torrent.php';
$torrent = new Torrent('[AnimeRG] Death Note (Complete) [Blu-Ray] [Multi] [1080p] [khatake2].torrent');
print_r($torrent->content());

Are you sure $torrent_path is a valid path (that can be resolved by your script) ?

the ouput is ok when i test with the above script:

Array(
    [[AnimeRG] Death Note (Complete) [Blu-Ray] [Multi] [1080p] [khatake2]/Extras/[AnimeRG] Death Note - Extra 01 (Eng) [BD] [khatake2].mkv] => 419016095
...
    [[AnimeRG] Death Note (Complete) [Blu-Ray] [Multi] [1080p] [khatake2]/[AnimeRG] Death Note - 37 [BD] [1080p] [Multi] [khatake2].mkv] => 531444483
)
prateekkathal commented 8 years ago

Yes! It is a valid path, everything seems to be running fine for the rest of the torrent files.

Can you try the other torrent file once? Is that working fine for you?

adriengibrat commented 8 years ago

Of course I've tested both torrent you provided. With out any issue.

adriengibrat commented 8 years ago

Check $torrent->errors () in your get_torrent_content method.

adriengibrat commented 8 years ago

i'm closing the issue, re open if you have new input / test file to provide