Сформировать путь к файлу с торрента?

Привет всем, прощу помочь сформировать путь к файлу с торрента.
Скрипт:

$dict = bdec_file('public/downloads/torrents/'.$id.'.torrent', (1024 * 1024) );
print_r($dict);


Результат:
Здесь

Торрент файл создан в Multiple File Mode.
Спецификации Multiple File Mode:

Info in Multiple File Mode
For the case of the multi-file mode, the info dictionary contains the following structure:
name: the name of the directory in which to store all the files. This is purely advisory. (string)
files: a list of dictionaries, one for each file. Each dictionary in this list contains the following keys:
length: length of the file in bytes (integer)
md5sum: (optional) a 32-character hexadecimal string corresponding to the MD5 sum of the file. This is not used by BitTorrent at all, but it is included by some programs for greater compatibility.
path: a list containing one or more string elements that together represent the path and filename. Each element in the list corresponds to either a directory name or (in the case of the final element) the filename. For example, a the file "dir1/dir2/file.ext" would consist of three string elements: "dir1", "dir2", and "file.ext". This is encoded as a bencoded list of strings such as l4:dir14:dir28:file.exte


Здесь спецификация
Как здесь написано, нужно сформировать путь к файлу.

Пытался сам сформировать, вот пример:
<?php
$dirname = $dict['value']['info']['value']['name']['value'];
echo $dirname;
?>

Результат получилось папка: test

Реальный путь к файлу /A_police_officer_with_the_ruble_in_2016_SATRip/test/

Формирует только предыдущую папку.

Как сформировать полный путь?
  • Вопрос задан
  • 203 просмотра
Решения вопроса 1
@bakhritdinov_b Автор вопроса
Все решил самостоятельно,
Причина:
Создал внутри папку A_police_officer_with_the_ruble_in_2016_SATRip еще 2 папки episode_1 episode_2 и все сработал.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы