Giter Site home page Giter Site logo

Comments (5)

7sDream avatar 7sDream commented on July 2, 2024

I don't quite understand what you mean and the problem you faced, but it seems something about fields' ordering in decoded dict?

I will try give you some solutions about the problem I guess, but if I guess wrong, fell free to provide more info and describe your question.


Are you using pytp CLI or use torrent_parser as a Python module?

If you're using pytp, it will by default use OrderedDict, and keeps fields' ordering. If you meet this problem when using pytp, please provide the torrent file you use and I will look into it.

If you're writing code using torrent_parser module, in fact parse_torrent_file function, TorrentFileParser class and BDecoder class both has a use_ordered_dict argument, set it to True will make them use OrderedDict too.

from torrent_parser.

Baltazar500 avatar Baltazar500 commented on July 2, 2024

Are you using pytp CLI or use torrent_parser as a python module?

I am using pytp under bash shell.

cat ./WormHole.torrent|pytp -a|jq -r '(.httpseeds[] + .info.name + "/" + .info.files[].path[])'
pytp -a ./WormHole.torrent|jq -r '(.httpseeds[] + .info.name + "/" + .info.files[].path[])'

If you're using pytp, it will by default use OrderedDict, and keeps fields' ordering. If you meet this problem when using pytp, please provide the torrent file you use and I will look into it.

https://www.upload.ee/files/11499058/Wormhole.torrent.html

If you're writing code use torrent_parser module, in fact parse_torrent_file function, TorrentFileParser class and BDecoder class both has a use_ordered_dict argument, set it to True will make them use OrderedDict too.

I do not know how to create scripts in python :(

from torrent_parser.

7sDream avatar 7sDream commented on July 2, 2024

It's OK~

I'll check the torrent file on weekends.

from torrent_parser.

7sDream avatar 7sDream commented on July 2, 2024

image

Yes, I can reproduce your result.

And it seems because of the torrent creator do not sort file by it's path, so, as a simple parser, pytp can only choose to keep the origin item order in a list……

So I'm sorry to say I can't do anything to solve this. But you can continue use sort util tool if you only want to get file names.

from torrent_parser.

Baltazar500 avatar Baltazar500 commented on July 2, 2024

So I'm sorry to say I can't do anything to solve this. But you can continue use sort util tool if you only want to get file names.

ОК.

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.