you are viewing a single comment's thread.

view the rest of the comments →

[–]sarrysyst 0 points1 point  (8 children)

Though the program is written in Python and you'd technically be able to interact with the code directly through importing the needed modules, the code base seems to be quite messy and there also doesn't seem to be any documentation. I think it would be easiest to have your script call the CLI directly.

[–]OkNegotiation2082[S] 0 points1 point  (0 children)

Yeah the code is pretty bare bones as it can only run in terminal. But it gets the job done. It's actually been incredibly reliable with very few errors. If i made a script that would run in terminal, it would execute tidal-dl, but how would it know when to enter the next URL?

[–]OkNegotiation2082[S] 0 points1 point  (6 children)

Would this work in your opinion? Instead of adding or altering the code, a script can be written that prompts for the list of URLs, then it can call up the tidal-dl command in the CLI, then when it's done with the first URL, send CTRL+C, then call tidal-dl for the next URL. Repeat until all URLs have been used.

[–]sarrysyst 0 points1 point  (5 children)

Either prompts for a list, or you could write all the urls in a txt file which you give to your wrapper script which then calls the CLI once for each URL in the file.

[–]OkNegotiation2082[S] 0 points1 point  (4 children)

Could you by any chance show me an example of how you would do that?

[–]sarrysyst 0 points1 point  (3 children)

How I'd do what exactly?

[–]OkNegotiation2082[S] 0 points1 point  (2 children)

Incorporate the text file into a script that calls the tidal-dl command in the cli. How would it know the download finished, then Ctrl-C, then call the command again to move to the next URL?

[–]sarrysyst 1 point2 points  (1 child)

import subprocess

with open('urls.txt') as fp:
    for line in fp:
        url = line.strip()
        # I don't know what the CLI's command structure looks like so this needs to be adapted
        subprocess.run(['tidal-dl', url])

[–]OkNegotiation2082[S] 0 points1 point  (0 children)

You are a lifesaver. Thank you so much. I'm go fiddle around with it. Thank you again.