How to read a *.torrent meta infos? I tried gedit and it cannot recognize the encodings and even nano give something incomprehensible. Afterwards, I made a simple C code to read the first 1000 characters and it works only for the first few characters. Here's the output:
Code:
d8:announce43:http://tracker.datorrents.com:6969/announce7:comment19:http://aerosubs.net10:created by13:uTorrent/180013:creation datei1224165828e8:encoding5:UTF-84:infod6:lengthi173765965e4:name38:Toradora_-_03[h264][848x480][Aero].mkv12:piece lengthi262144e6:pieces13260:C�Q����W|���ԫ��ظ{pkn@od��W�a��B���fb|�����A�*��0:���C�9 }�+�}D��C��u?���ߧp��>�!����f9H�7�Q8H��
��c��EU��bx��;�ڋ��~%u@)� �b�k';H���x���v��v������I��_�|N(����T{4���TH8�M��A`��{K�&�y���52C!�k�K��� �����&v[������
���c·ÀKå;³¬A<5ÄÝò7�ûÿ␊␍©␌Ùì[„³Ñ£ùäÑÔç�Ÿ\À�├à⎻Å!ï@(Œ¡ï⎼ì¼Ç�Êç¹ôôºM¾┌Ë≥‡├…]œ«Å¦0W“ž¼Û«
G“] ¨ë│¢€!å␉æGÞ« ñ•,ý®èÚ?씑≥çÒáí- NW𜼅·DÕŒÔ�ºπ⎼
˯ÏÉ®þ│TLÝ6žÈ0AŸPYT´P��.F»êöMá‘ø.†9îÔ’ÁT⎺$=KBHÕ?ôá_≥�E0¸\MLAÒ─±ìˆŒ␊┌²žõQ”œ5øú‰ÊËI⎽û°¦ù4‹⎽’8ƒ├┐
3á®ðñÎÈ�7·Qù ©*│ŒúÍ·…¿ôÝ÷��
+µ�¸8F‡J>–á4™Hµ•KÇ. %%“L
And the codes used to read it is this one.
Code:
#include <stdio.h>
int main(int argc, char *argv[])
{
int k;
char data;
FILE *torrentfiles;
torrentfiles=fopen(argv[1],"r");
//printf("%d\n",argc);
for (k=0;k<1000;k++)
{
fscanf(torrentfiles,"%c",&data);
printf("%c",data);
}
printf("\n");
fclose(torrentfiles);
return 0;
}
I know that the metainfos are bencoded, but my objective is only to display everything, so how should I do that? Thanks for any advice.
Bookmarks