#1461
|
|||
|
|||
![]() Quote:
|
#1462
|
|||
|
|||
![]()
Hi.
So I got Event Scripter installed now and I would like JD to do a few things after finished downloads but only to certain files. I want to cut out the first 7 seconds of any video downloaded from saidwebsite I have the ffmpeg command line in a .bat file now that I run inside the folder with the videos. I also use the packagizer in JD for saidwebsite so files are grabbed and downloaded into specific folder - <jd:prop:username> I would be very happy if I could automatize some of all this manual work. After download what i specifically want to happen is 7 first seconds cut out of the video & the new file must overwrite the old file in the folder Then I only have the renaming of files to do manually afterwards - but if possible I would like to have that automated too ![]() I use bulk rename utility right now and I have a template that: removing chars: Code:
///#,_-¦¡/¿'.;()// Code:
480p 4k 720p 1080p 1440p 2160p I would also like to have the file prefix to be the performers name & I would like to have the performers username at the end of the title removed. It sounds like a lot - I know - and it is a lot of manual work right now. Any help getting this more automatic is really appreciated. Last edited by raztoki; 16.07.2020 at 23:44. |
#1463
|
|||
|
|||
![]() Quote:
i make so: var links = archive.getDownloadLinks() || []; And then if links.length > 0 I take it for automatical extract otherwise I take it for manual extract. Is safe? Or better idea? Because your code must only run when manual extract. Last edited by sherbee; 24.07.2020 at 09:36. |
#1464
|
|||
|
|||
![]() Quote:
Code:
var getArchiveFiles = function() { return archive.getExtractionLog().match(/\((DownloadLink|File)ArchiveFile\)File:[^|]+/g).map(function(string) { return string.replace(/.+?:(.+)/, "$1"); }); } Or use it with existing archive methods: Code:
var getArchiveFiles = function() { var archiveLinks = archive.getDownloadLinks(); if (archiveLinks) { return archiveLinks.map(function(link) { return link.getDownloadPath(); }) } else { return archive.getExtractionLog().match(/\(FileArchiveFile\)File:[^|]+/g).map(function(string) { return string.replace(/.+?:(.+)/, "$1"); }); } } Common usage for both functions: Code:
getArchiveFiles().forEach(function(file) { // Do something with each archive file // alert(file); }); |
#1465
|
|||
|
|||
![]() Quote:
Code:
return archive.getExtractionLog().match(/\((DownloadLink|File)ArchiveFile\)File:[^|]+/g).map(function(string) { I don't know what is wrong for automatic extraction after download no such error. Last edited by sherbee; 25.07.2020 at 09:09. |
#1466
|
|||
|
|||
![]()
I am unable to reproduce the error. Open the extraction log to check if it matches the regex pattern used in the script (just in case if it is language dependent), and modify if necessary.
|
#1467
|
|||
|
|||
![]() Quote:
But still 'TypeError: Cannot call method "match" of null'' So I look in log folder. Interesting: 1s time manual extract => Error. When retry same file => No error. Other error happen: Wrapped org.appwork.exceptions.WTFException: java.io.FileNotFoundException: Now I see there is /open folder in log folder. When extracting log goes in open folder then moved in extracting folder. So I think null-error happen when log is still in 'open' folder so it cannot find it? Maybe this is reason? Or it wants find it in 'open' folder and it already in 'extracting' folder? |
#1468
|
|||
|
|||
![]() Quote:
Code:
var getArchiveFiles = function() { var log = archive.getExtractionLog(); var count = 60; // max. seconds to wait for log while (!log && count) { log = archive.getExtractionLog(); count--; sleep(1000); } if (log) { return archive.getExtractionLog().match(/\((DownloadLink|File)ArchiveFile\)File:[^|]+/g).map(function(string) { return string.replace(/.+?:(.+)/, "$1"); }); } else { alert("Log file for archive \"" + archive.getName() + "\" not found."); return []; } } getArchiveFiles().forEach(function(archiveFile) { // Do something with each archive file // alert(archiveFile); }) |
#1469
|
|||
|
|||
![]() Quote:
Still geting error like: 'Wrapped org.appwork.exceptions.WTFException: java.io.FileNotFoundException: \jdownloader\logs\extracting\*.txt' But it should report error message: 'Log file for archive "" + archive.getName() + "" not found.' Right? So log check not works? |
#1470
|
|||
|
|||
![]() Quote:
Alternatively, you can use while loop to check the folder contents of 'open', and execute the script only after it is empty. It might then even work even without 'log = null' check. Unfortunately I cannot test it since I am unable to reproduce the error. Feel free to find me in JD Chat if need any help with the script/troubleshooting. Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader |
#1471
|
|||
|
|||
![]() Quote:
Code:
getArchiveFiles().forEach(function(archiveFile) { // Do something with each archive file alert(archiveFile); }) In single cases for example I manual extract file xyz.7z. But 'alert(archiveFile)' gives filename: xyz_2.7z. When check I see file package name xyz with file name xyz_2.7z alrready in download list from earlier time. So function not gives name from actual extract, but from some extraction earlier. ![]() I can see in log from actual extract, that correct file xyz.7z i have select. That is not good. I see 3 times now. Always same: Extract file filename.7z manual. but name shows filename_2.7z and after check I see file with filename_2.7z already in download list from time ago. Actual log but show filename.7z. Maybe it same reasen that makes bug I have report: https://board.jdownloader.org/showpo...54&postcount=8 It's problem because I take 'archiveFile' for move file automaticall after extract. So when it gives wrong filename, file cannot find to move. Last edited by sherbee; 26.07.2020 at 06:58. |
#1472
|
|||
|
|||
![]()
Looks like it is related to the issue you reported. If the API method returns the wrong log, nothing can be done in the script to verify/rectify it.
If you can run a local file server, you can load the archive files to JD and generate 'local' download links which can be automatically extracted. While it may not solve the wrong 'log' or 'status' problem, you should be able to move the links using a script, without any issues. |
#1473
|
|||
|
|||
![]() Quote:
So must take correct extraction log and use instead. So idea is to make manual: 1. Get extraction log 2. Open extraction log 3. And use 'Archive Path:'-value Is there not API to extract values from log? I think would be useful if simply could make like: getLogValue(logfile).archivepath or getLogValue('Archive Path') and result would be archive path like: 'c:\user\sherbee\downloads\xyz.7z' So this could work? And how? |
#1474
|
|||
|
|||
![]() Quote:
Code:
var match = readFile(getPath(path_to_correct_log_file)).match(/Archive Path\: (.+)/); if (match) { var archivePath = match[1]; alert(archivePath); } |
#1475
|
|||
|
|||
![]()
I try thanks. But you have idea how to get correct path to log file and name? I see no method for it. And not written in any logs to extract? Take last log by date i think not reliable.
|
#1476
|
|||
|
|||
![]()
You don't need to get the correct log file, or even any other data from the 'extraction finished' trigger. You can use any trigger (For e.g. JD started, interval) and loop through the log files of last 'x' hours present in the 'extracting' folder. Parse the content of each file to check if the extraction was 'successful', and if so get a list of 'archive files' and move them. If the log has not already been processed before, the 'archive files' will still be present in the folder and can be moved by the script.
|
#1477
|
|||
|
|||
![]()
Hello fellow programmiers
![]() I would like to sometimes shutdown the linkgrabber organisation: Like if i enter 1 link, it will be shown under "verschiedene dateien" (dunno the english name for it), if i than enter 2 more links with part 1 and part 2, they won't be inside the "verschiedene dateien", they get a new folder with the name of these files. Anyone has an idea how to change that? That ALL Links/Files being in one folder no matter if there are lonely links or links with part 1-x? Ideally with a button for on/off ... Thx Mydgard PS: If Possible must be a ready script as i don't understand this scripting sry :D |
#1478
|
||||
|
||||
![]()
@Mydgard
verschiedene dateien = various files in english the title is just various, you can disable various in advanced settings settings > advanced settings > LinkgrabberSettings.variouspackageenabled you can also edit a threshold which links are no longer in various LinkgrabberSettings.variouspackagelimit
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#1479
|
|||
|
|||
![]() Quote:
I need: 1. Open archive 2. Extract archive 3. Move archive 4. Open next archive Must move archive after extraction immediately. |
#1480
|
|||
|
|||
![]()
It effectively does the same thing. The files will be moved as soon as the log file is available in the 'extracting' folder and queried. How fast you want it to be processed will depend on the the trigger you use.
|
![]() |
Thread Tools | |
Display Modes | |
|
|