Comments (5)
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.
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.
It's OK~
I'll check the torrent file on weekends.
from torrent_parser.
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.
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)
- UnicodeDecodeError: 'utf8' codec can't decode byte 0xb5 in position 1: invalid start byte HOT 4
- Changing trackers in announce-list corrupts save HOT 7
- Missing dependency typing_extensions HOT 3
- torrent_parser does not return "Info Hash v1" value HOT 6
- add functions to calculate v1 and v2 info hashes of torrent files HOT 3
- Python2.7 处理不存在的文件时出现 NameError: global name 'FileNotFoundError' is not defined HOT 1
- hello,I find something wrong in you code.. HOT 4
- UnicodeDecodeError HOT 7
- Same error with every torrent. HOT 2
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 43 HOT 2
- v2 Torrent supported? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torrent_parser.