Comments (5)
I think I've fixed both issues in 4.2.0.
I hope this works better for you.
from torf.
I come across this issue when reading torrent files from this dataset. I loaded some of the torrent files that fail verification with a torrent client and they load and download fine.
I also get "Invalid metainfo: ['info']['name'] must be str, not bytes" when the name (or a filename) contain a non ascii character.
I think this is caused by the bdecoder returning bytes if the string contains a non ascii character.
Looking forward to your thoughts on these issues.
from torf.
from torf.
Returning strings as two different types wouldn't be very friendly although it would fix the problem.
I don't think using chardet would be a good idea either because of what you've mentioned.
One solution would be to not decode strings, leaving them as bytes. Users would have to decode the strings themself and dict keys would also be in bytes. A bit of a major change to the library. This seems to be the best option for compatibility. Or just a 'bytes mode' where strings aren't decoded.
Another solution would be to decode to utf-8 with errors being ignored or replaced. I've tested a few of the trouble torrents with libtorrent 2.0.7 in Python and libtorrent appears to replace non-utf_8 characters with an underscore.
from torf.
from torf.
Related Issues (20)
- File conflict with python-hypothesis HOT 4
- Question remove file HOT 6
- v2 Torrent - Invalid metainfo: Missing 'pieces' in ['info'] HOT 1
- A question about source flag. HOT 1
- Is it possible to use single file with multi-file type directory struture? HOT 4
- Missing __enter and __exit method HOT 8
- How can I make it not create a directory HOT 1
- Is it possible to add a file with a different filename inside the torrent? HOT 4
- Too many open files HOT 5
- [Feature request]load torrent file from bytes object. HOT 1
- infohash got changed after load, without any modification HOT 1
- Add link to torf-gui in readme HOT 5
- Allow setting 32MB piece size HOT 9
- `collections.abc.ByteString` is deprecated in Python 3.12 and will be removed in Python 3.14 HOT 1
- License HOT 4
- Create single file torrent from a stream HOT 5
- Allow creating 64 MB piece size HOT 2
- Subfolders HOT 2
- torf should prefer .utf-8 keys when they exist HOT 1
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 torf.