kiwix / libkiwix

Common code base for all Kiwix ports
https://download.kiwix.org/release/libkiwix/
GNU General Public License v3.0
112 stars 55 forks source link

Hack for mirrobrain magnet URIs #1001

Closed rgaudin closed 9 months ago

rgaudin commented 9 months ago

As per #938, in regard to https://github.com/kiwix/container-images/issues/242, this adds some processing to the creation of the magnet: link for downloads.

It mostly fixes the parameter names/values of the magnet string but also fetches the list of mirrored URLs (using metalink) to add them as alternative webseeds.

Tested with Vuze/Azureus on Windows as well as Tixati on Windows (Tixati is smart enough to retrieve metalink from the webseed and thus didn't even need the extra ws=).

Please note that while Transmission understands it's multiple webseeds, there's no support for fetching the torrent/DHT and so the download never starts. Don't be fooled 😉! I guess it's similar in most other torrent client (most of them dont support webseed magnets).

Suggestion: target="_blank" for magnet is really annoying (leaves a blank tab open). I think it should be removed.

rgaudin commented 9 months ago

@veloman-yunkan thank you ; is any of the commit history worth keeping? I think it can all be squashed into one. WDYT?

veloman-yunkan commented 9 months ago

@veloman-yunkan thank you ; is any of the commit history worth keeping? I think it can all be squashed into one. WDYT?

@rgaudin I concur with you on this. In fact I wanted to suggest that in my approval but didn't want to appear too finicky. :)

rgaudin commented 9 months ago

Done ; it's rebased off main as well. Thank you for your time.

kelson42 commented 9 months ago

@veloman-yunkan @rgaudin @mgautierfr Unfortunately I can not merge because the CI is red and the error seems worrying.

mgautierfr commented 9 months ago

The cacheid has to be adapted as static files have been changed. See Static files compilation section in the README.

codecov[bot] commented 9 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (2650cdd) 38.92% compared to head (ab0d7b6) 38.92%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1001 +/- ## ======================================= Coverage 38.92% 38.92% ======================================= Files 58 58 Lines 3990 3990 Branches 2201 2201 ======================================= Hits 1553 1553 Misses 1090 1090 Partials 1347 1347 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rgaudin commented 9 months ago

@mgautierfr thanks for the explanation. @kelson42 it's now green