Opened 9 years ago

Closed 9 years ago

Last modified 4 years ago

#2174 closed bug (Fixed)

Unable to add torrent via URL

Reported by: underscor Owned by:
Priority: minor Milestone: 2.x
Component: Console UI Version: master
Keywords: Cc:

Description

Hi guys! I get the following when attempting to add a torrent via URL. Any ideas?

deluge-console 'add -p "/1/downloads/9c8534b29cce486a571aa76f8225c35ee2e29d6d_wcd_ketsui-extra--dodon_manabu-namiki-_flac_lossless_1644875" "http://bt-download04/torrents.php?action=download&id=1644875&authkey=c28aba95c183165ef8ed2e8ae6a3bbbd&torrent_pass=4np8z7qkzb6dbv8pzdbqoqznvm7avir1"'
/1/"http:/bt-download04/torrents.php?action=download&id=1644875&authkey=c28aba95c183165ef8ed2e8ae6a3bbbd&torrent_pass=4np8z7qkzb6dbv8pzdbqoqznvm7avir1" doesn't exist!

Change History (11)

comment:1 Changed 9 years ago by damoxc

Can you try without the double quotes? I think that my be the issue, when I looked they were still attached to the arguments. Obviously not correct but may allow you to continue with your testing :)

comment:2 Changed 9 years ago by underscor

Hah, that fixed it! Interesting... I assume that's not the intended behaviour, right?

comment:3 Changed 9 years ago by damoxc

I'd imagine not, should be an easy fix though, gimmie a few minutes

comment:4 Changed 9 years ago by damoxc

Actually I'd like to talk to the console ui author before making any changes to see if there's any reason that they're doing it the way they are instead of just using the shlex module. I'll update this ticket when the problem is resolved!

comment:5 Changed 9 years ago by underscor

Awesome, thanks!

comment:6 Changed 9 years ago by damoxc

Hi,

Would you mind testing out the following patch and seeing if it works for you?

  • deluge/ui/console/main.py

    diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py
    index 55a5c68..052e556 100644
    a b  
    4141import re 
    4242import locale 
    4343 
     44try: 
     45    import shlex 
     46except ImportError: 
     47    shlex = None 
     48 
    4449from twisted.internet import defer, reactor 
    4550 
    4651import deluge.component as component 
    def epilog(self): 
    266271    def split(self, text): 
    267272        if deluge.common.windows_check(): 
    268273            text = text.replace('\\', '\\\\') 
    269         result = re.split(r"(?<!\\) ", text) 
     274        if shlex: 
     275            result = shlex.split(text) 
     276        else: 
     277            result = re.split(r"(?<!\\) ", text) 
    270278        for i, s in enumerate(result): 
    271279            result[i] = s.replace(r'\ ', ' ') 
    272280        result = filter(lambda s: s != '', result) 
    def write_event(self, s): 
    475483                component.get("LegacyUI").add_line(s, False) 
    476484                self.events.append(s) 
    477485        else: 
    478             print colors.strip_colors(s.encode(self.encoding)) 
    479  No newline at end of file 
     486            print colors.strip_colors(s.encode(self.encoding)) 

comment:7 Changed 9 years ago by Cas

  • Milestone changed from Future to 1.4.0
  • Priority changed from critical to minor

comment:8 Changed 9 years ago by underscor

Sorry, I've been sick. I will recompile with the patch tomorrow and let you know. Thanks!

comment:9 Changed 9 years ago by underscor

Totally dropped the ball on this.

The patch fixes the problem for me. Thanks <3 :)

comment:10 Changed 9 years ago by Cas

  • Resolution set to fixed
  • Status changed from new to closed

Fix in master: b67bae31

comment:11 Changed 4 years ago by Cas

  • Milestone changed from 2.0.x to 2.x

Milestone renamed

Note: See TracTickets for help on using tickets.