Skip to content

Can't download a pack searched via a SearchEngine #18

@itsjustdeepred

Description

@itsjustdeepred

Hi
I'm unable to download a pack searched using XDCC_EU Search engine

from xdcc_dl.xdcc import download_packs
from xdcc_dl.pack_search import SearchEngines

results = SearchEngines.XDCC_EU.value.search("test")

download_packs(results)

I get:

Traceback (most recent call last):
File "/home/user/PycharmProjects/pythonProject/main.py", line 7, in
download_packs(results)
File "/home/user/.local/lib/python3.8/site-packages/xdcc_dl/xdcc/init.py", line 51, in download_packs
for pack in packs:
TypeError: 'XDCCPack' object is not iterable

Even when using your example:

from xdcc_dl.xdcc import download_packs
from xdcc_dl.pack_search import SearchEngines
from xdcc_dl.entities import XDCCPack, IrcServer

# Generate packs
manual = XDCCPack(IrcServer("irc.rizon.net"), "bot", 1)
from_message = XDCCPack.from_xdcc_message("/msg bot xdcc send #2-10")
search_results = SearchEngines.HORRIBLESUBS.value.search("Test")
combined = [manual] + from_message + search_results

# Start download
download_packs(combined)

I get:

Traceback (most recent call last):
File "/home/user/PycharmProjects/pythonProject/main.py", line 9, in
combined = [manual] + from_message + search_results
TypeError: can only concatenate list (not "XDCCPack") to list`

I also tried to add a random.choice() in order to select a random choice from the packs list returned by the SearchEngine function without success. Am I doing something wrong or is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions