Ticket #2087: 0001-unquote-magnet-URIs-before-adding-them.patch

File 0001-unquote-magnet-URIs-before-adding-them.patch, 1.1 KB (added by Raziel.Azrael, 12 years ago)

A patch to unquote magnet URLs before loading them with libtorrent

  • deluge/core/torrentmanager.py

    From 347781823b92b9f390bc1514ad3a3f9d59068460 Mon Sep 17 00:00:00 2001
    From: notk0 <notk0@notk0-G73Jh.(none)>
    Date: Mon, 16 Apr 2012 20:55:46 +0200
    Subject: [PATCH] unquote magnet URIs before adding them
    
    ---
     deluge/core/torrentmanager.py |    3 ++-
     1 files changed, 2 insertions(+), 1 deletions(-)
    
    diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
    index df94550..5dd76cc 100644
    a b  
    4242import shutil 
    4343import operator 
    4444import re 
     45from urllib import unquote 
    4546 
    4647from twisted.internet import reactor 
    4748from twisted.internet.task import LoopingCall 
    def add(self, torrent_info=None, state=None, options=None, save_state=True, 
    449450        handle = None 
    450451        try: 
    451452            if magnet: 
    452                 handle = lt.add_magnet_uri(self.session, utf8_encoded(magnet), add_torrent_params) 
     453                handle = lt.add_magnet_uri(self.session, utf8_encoded(unquote(magnet)), add_torrent_params) 
    453454            else: 
    454455                handle = self.session.add_torrent(add_torrent_params) 
    455456        except RuntimeError, e: