Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linkgrabber.add_links not working #36

Closed
MJD96 opened this issue Dec 30, 2020 · 2 comments
Closed

Linkgrabber.add_links not working #36

MJD96 opened this issue Dec 30, 2020 · 2 comments
Assignees

Comments

@MJD96
Copy link

MJD96 commented Dec 30, 2020

I used this code, but the only parameter that seems to work is "links". Because when I open Jdownlader, the link is added but everything is set by default.

lincs=myjdapi.myjdapi.Linkgrabber(device) #objeto del Linkgrabber

url='https://www.youtube.com/watch?v=d6DP_u6ogqc' 
youtuber = 'Ciudadano Z'
fecha = time.ctime()
lincs.add_links([{
                      "autostart": False,
                      "links": url,
                      "packageName": 'tu vieja',
                      "extractPassword": None,
                      "priority": "DEFAULT",
                      "downloadPassword": None,
                      "destinationFolder": r'C:\Users\MARIANO\\' ,#Downloads\Jdownloader\\'+ youtuber + '\\' + fecha,
                      "overwritePackagizerRules": False
                  }])
@mmarquezs
Copy link
Owner

mmarquezs commented Jan 2, 2021

You aren't the first to be confused by this. The thing is that JDownloader has a "Packagizer". This "Packagizer" automatically sets up the destination path, creates subfolder, automatically names the folder/package and other things.

So even if you set up those fields manually if the packagizer is active it will override your settings once the link is added to the linkgrabber.
If you want to avoid that you either disable the packagizer, modify the Packagizer settings or you use the flag to overwrite the packagizer rules for that link, the flag is the api parameter called overwritePackagizerRules, set to true overwrites the packagizer rules .

Disabling the Packagizer is a simple option if you have access to the GUI. In Setting you can easily find it. Without acces to the GUI I'm not sure if it's possible I haven't looked much into the settings api.

If you want to modify the Packagizer settings to be honest there are some issues, first as before I am not sure the api supports it and if it does, my api doesn't have specific functions for it so it might require to use the GUI to change its settings. Second, some things I don't think they can be changed, for example, although I managed to disable the rule that overwrites the destination folder I couldn't find a way to disable the package name overwrite from the Packagizer. In any case the settings are in Settings -> Packagizer (or in Spanish Opciones -> Empaquetador) )

It's much easier to use the flag, specially if you don't want to have to use the GUI or settings api, you only have to set the "overwritePackagizerRules" as True to override the packagizer and that's it.

An other alternative that I didn't consider because is more annoying is to modify the package once it has been added and the packagizer has been triggered.

Other things to take into account:

  • If the link already exist in the LinkGrabber beaware it won't update it's settings, replace it or add a duplicate/second. Even if the package name is different,etc. if it's the same link it's the same existing and doesn't touch it.
  • The autostart isn't immediate you might see the link in the LinkGrabber for some time before it jumps to downloads.
  • If the link is already in the downloads list and then you add it again in the linkgrabber with autostart, it won't autostart, even if the destination path is different, package name different etc... JDownloader considers it a duplicated and won't download it, in the GUI there is a popup about it and asks if you want to allow duplicates... as it is now I'm not sure in the official API how that could work.

Anyway so far what I have checked seems to work as intended. Feel free to close the issue if that's all.

Finally unless you need features specific from JDownloader or you want a shared place for all kinds of downloads, I recommend you to user youtube-dl and some library on top of it instead for youtube downloads.

@MJD96
Copy link
Author

MJD96 commented Jan 3, 2021

Great, I set "overwritePackagizerRules" to True and it works perfectly

Thank you very much for your response

@MJD96 MJD96 closed this as completed Jan 3, 2021
@mmarquezs mmarquezs self-assigned this Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants