Comments (4)
I am trying to understand how this is formatted. Right now parsing it manually by hand to JSON:
{
"interval": 900,
"peers": "ip",
"213.49.181.984": "port", // also this is not a valid IP address
//This is where it fails. A number cannot be a key in a bencode dict
}
I have also tried running it through a some other bencode parsers and they all fail at the same spot. Are you actually able to get it decode with anything? As far as I can tell it is malformed. If you are able to get it to decode please let me know.
My guess is that the peers are supposed an array of dictionaries as that is what would make the most logic sense but that is not what the data specifies.
from bencode.
请考虑下中文编码的问题, 还有种子文件中的pieces字段的值
-
Consider Chinese encoding
-
torrent --> info --> pieces
from bencode.
@blanexie Chinese characters should parse fine as long as you pass a Charset that can understand them. Do you have an example of valid bencode formatting with those characters in a string that is not parsing correctly?
from bencode.
thanks , It's normal to run.
- useBytes : true
- ByteBuffer to convert into String
kotlin code
val bencode = Bencode(charset("utf8"), true)
UTF8.decode((infoMap["name"] as ByteBuffer)).toString()
from bencode.
Related Issues (3)
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 bencode.