m13253 / danmaku2ass

Convert comments from Niconico/AcFun/bilibili to ASS format
http://m13253.blogspot.com/2013/11/play-danmaku-offline-danmaku2ass.html
GNU General Public License v3.0
556 stars 92 forks source link

Current comment file format probe algorithm is not robust #9

Closed m13253 closed 8 years ago

m13253 commented 10 years ago

Currently, Danmaku2ASS probes comment file format by prefetching the first bytes.

However, this may fail because there may be some <!-- XML comments --> (#8) or the JSON object may be reordered.

I am considering a robust algorithm which look into the XML or JSON format to figure out which file format is used.

lolnameless commented 10 years ago

I am too lazy to gather sample from each site, but by looking into the code I think different site has by no mean robust format which makes friendly for library, so I suggest that there MUST be an option let the user manually declare where the danmaku is coming from, regardless how robust the library automatically handles.

alexvong243f commented 9 years ago

I have added 5 lines of if-else to support NicoFox because I am using it. Feel free to pull or not to. Thanks.

m13253 commented 9 years ago

I have added 5 lines of if-else to support NicoFox because I am using it. Feel free to pull or not to. Thanks.

Pulled. Thanks for your improvements.

Maybe I will do a complete refactor this summer, introducing a better algorithm at that time. It's hard to say whether I will have time then. :smile:

alexvong243f commented 9 years ago

Maybe also doing a reformat if have time? The 79 column rule :P

m13253 commented 9 years ago

Maybe also doing a reformat if have time? The 79 column rule :P

Yeah. I can't even face the source code I have written before. So ugly. I need some reformat this summer vacation.

m13253 commented 8 years ago

Fixed in #38