Giter Site home page Giter Site logo

Comments (6)

7sDream avatar 7sDream commented on July 21, 2024 1

图片

Just write a test using the file you provide, it's the same in this case.

PS: hash_raw=True must be provided to (try my best to) ensure result of encoding is as same as origin data.

from torrent_parser.

7sDream avatar 7sDream commented on July 21, 2024

Please provide a torrent file that make you have this issue, for testing purposes.

And the mean of "info Hash v1" is not clear, some screenshot or log of transmission-show maybe helpful.

from torrent_parser.

kkuriyama avatar kkuriyama commented on July 21, 2024

This is the output of transmission-show, The "Hash" value is also referred to as "Info Hash v1" on qbittorrent. It is the "Hash" value that I am trying to get from pytp.

Name: xubuntu-22.04-desktop-amd64.iso
File: xubuntu-22.04-desktop-amd64.iso.torrent

GENERAL

  Name: xubuntu-22.04-desktop-amd64.iso
  Hash: f435d2324f313bad7ff941633320fe4d1c9c3079
  Created by: mktorrent 1.1
  Created on: Thu Apr 21 04:02:51 2022
  Comment: Xubuntu CD cdimage.ubuntu.com
  Piece Count: 10306
  Piece Size: 256.0 KiB
  Total Size: 2.70 GB
  Privacy: Public torrent

TRACKERS

  Tier #1
  https://torrent.ubuntu.com/announce

FILES

  xubuntu-22.04-desktop-amd64.iso (2.70 GB)

This is a snippet of the pytp output as the original is ~400KB.

{"announce": "https://torrent.ubuntu.com/announce", "comment": "Xubuntu CD cdima
ge.ubuntu.com", "created by": "mktorrent 1.1", "creation date": 1650549771, "inf
o": {"length": 2701512704, "name": "xubuntu-22.04-desktop-amd64.iso", "piece len
gth": 262144, "pieces": ["8cadae7758f70a8ea1436eeb0f5652a98490b403", "0b303e6617
e84c37edbe52d7a82e5a7533bfcdce", "6b239e36ba8a4301f36383613ecb064e489b9990", "36
bf90f9dce84508628fb4aab9dd5ca7abe950d8", "24a44ee3ea3ca316ef5e9323e3fce4045e7d1f
84", "5e621209bef519529508d24ad5fddf549a32422c", "d641c2d4e07713490747f22fb76aea
206e319c03", "42101ebbb4feaa44b6ff24c63942f770d0510136", "49e648f3bf657adb65c6fd
38ecf870f5118af104", "6077160ac9752477d702c38a125b2d1684da85da", "2002f583676a15
dfd2232dd1fc48c6013a26f080", "286ce9b025c646badf3d8264617d1b5343702458", "772268
df32e9078d1ba9fe38ebb2823ec1b64b49", "74a91f948242eafa56380ec85b6ab5b66ed44d21"

The link to the torrent file is: https://torrent.ubuntu.com/xubuntu/releases/jammy/release/desktop/xubuntu-22.04-desktop-amd64.iso.torrent

Thank you for your assistance.

from torrent_parser.

7sDream avatar 7sDream commented on July 21, 2024

I did some digging in tramsmission source code, and found info hash is actually a SHA1 checksum of torrent file's info object binary bytes.

This value is not stored in files itself, but be caluclated during parse process, so current this project do not show it.

The only way I can see is after parse the file, we encode the info object into binary bytes again and calulate the hash, It (in theory) will be the same value as transmission-show shows.

from torrent_parser.

kkuriyama avatar kkuriyama commented on July 21, 2024

Thank you. I'll use transmission-show for now.

from torrent_parser.

7sDream avatar 7sDream commented on July 21, 2024

That's OK, this project is basicly a torrent format encoder/decoder, use transmission-show is more reasonable if you want features more than that.

But I think we can build our own transmission-show like tools above this project, the only obstacle is that I don't have enough time. 😭

from torrent_parser.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.