#2621
|
|||
|
|||
![]() Quote:
|
#2622
|
|||
|
|||
![]()
Hi, as the title say mgpai's script seems not to work fully. I'm talking about
Save youtube links and basic information to a html page Code:
// Save youtube links and basic information to a html page. // Trigger required: "A Download Stopped" // Get link property String.prototype.prop = function() { return link.getProperty(this); }; // Convert duration to hh:mm:ss.ms format Date.prototype.duration = function() { var ms = parseInt((this % 1000) / 100); var ss = parseInt((this / 1000) % 60); var mm = parseInt((this / (1000 * 60)) % 60); var hh = parseInt((this / (1000 * 60 * 60)) % 24); hh = (hh < 10) ? "0" + hh : hh; mm = (mm < 10) ? "0" + mm : mm; ss = (ss < 10) ? "0" + ss : ss; return hh + ":" + mm + ":" + ss + "." + ms; }; // Get media bitrate Number.prototype.toKbps = function() { return ((this / mediaDuration) * 8).toFixed(2); }; // youtube media check var youtubeMedia = link.getHost() == "youtube.com" && (/\.(m4a|aac|ogg|mp3|mp4|webm)$/).test(link.getName()); // Get Data if (youtubeMedia) { var output = []; var variant = JSON.parse("YT_VARIANT".prop()); var variantData = JSON.parse(variant.data); var youtube = "<a href=\"" + "http"+ "s://youtube.com/"; var saveFile = link.getDownloadPath() + ".info.html"; var fileSize = link.getBytesTotal(); var demux = (/DEMUX/).test(variant.id); var audioSize = !demux ? "DASH_AUDIO_SIZE".prop() : fileSize; var videoSize = "DASH_VIDEO_SIZE".prop(); var mediaDuration = "YT_DURATION".prop(); var data = { Video: youtube + "watch?v=" + "YT_ID".prop() + "\">" + "YT_TITLE".prop() + "</a>", Playlist: "YT_PLAYLIST_ID".prop() && "YT_PLAYLIST_TITLE".prop() ? youtube + "playlist?list=" + "YT_PLAYLIST_ID".prop() + "\">" + "YT_PLAYLIST_TITLE".prop() + "</a>" : null, User: youtube + "user/" + "YT_USER_NAME".prop() + "\">" + "YT_USER_NAME".prop() + "</a>", Channel: youtube + "channel/" + "YT_CHANNEL_ID".prop() + "\">" + "YT_CHANNEL".prop() + "</a>" + "\r\n", Published: new Date("YT_DATE".prop()).toDateString(), Size: (fileSize / 1048576).toFixed(2) + " MiB", Duration: new Date(mediaDuration).duration(), Width: variantData.width, Height: variantData.height, FPS: variantData.fps, Audio_Bitrate: audioSize.toKbps() + " kbps", Video_Bitrate: !demux && fileSize > audioSize ? videoSize.toKbps() + " kbps" : null, Overall_Bitrate: !demux && fileSize > audioSize ? fileSize.toKbps() + " kbps" : null, Variant_ID: variant.id, }; // Generate output[] for (i in data) { if (data[i] && data[i] != -1) { output.push(i.replace(/_/g, " ") + " : " + data[i]); } } // Format output[] and save to html file try { deleteFile(saveFile, false); // Delete info file if it already exists on the disk. writeFile(saveFile, "<pre>" + output.join("<br>") + "</pre>", false); } catch (err) { log(err + ""); } } When video stops downloading I get error: "TypeError: Cannot call method 'toKbps' of null (#43)" which results in script turning off in the Event Scripter which is irritating. I removed lines which had "toKbps" in them and there was no error but I would like to keep info regarding bitrate in html. I know that the script was written in 2016. I presume that there were some changes in youtube which make parts of this script to not work ideally. Any ideas how to fix the script? |
#2623
|
|||
|
|||
![]() Quote:
I simply created a script checking for files in use and depending on the result it went ahead or stopped. Put that script in a hourly running cronjob and that's it. |
#2624
|
||||
|
||||
![]()
Merged EventScripter related threads.
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#2625
|
|||
|
|||
![]()
Hello mgpai and friends,
I need a way to make JD2 notify me of URLs caught by Linkgrabber that are NOT supported. Currently, JD2 doesn't do anything with those links, and doesn't notify me that they are not supported. If I add several links (via clipboard monitoring or a text file), the links that aren't supported by JD2's plugins should be listed somehow, so I can find another way to download them. The best way would be a custom view on Linkgrabber ("Not supported", "Unavailable", "Error", anything that warns me that JD can't download them). Is it doable? |
#2626
|
||||
|
||||
![]()
@GreenXIII
I know this won't help you now but I wanted to point out that you are not the first user asking for such a feature to be added. Related thread: Click
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#2627
|
|||
|
|||
![]()
How I can write a script to rename all file I download that contains the character _ with character . ?
Example : I want to automatically rename this I_Hate_Suzie_2021_1x01.mp4 in this I.Hate.Suzie.2021.1x01.mp4 I tried to do a packagizer rule that for every file that contains * in the name rename it in (I tried to write a regex formula similar to sed) /_/\./ but it not work. Can you help me?
__________________
Amcucchi Last edited by amcucchi; 31.05.2023 at 12:15. |
#2628
|
|||
|
|||
![]()
Can someone write me a script that will rename a file to all lowercase once download is complete? For example: a file named SomeRandomFile123.txt changed to somerandonfile123.txt. Apologies for outright asking for the code, but I'm just not familiar with Java at all and only installed JDownloader recently. Please and thank you.
|
#2629
|
|||
|
|||
![]()
Hallo liebe Leute.
Da ich mit dem Scripten selbst gar keine Erfahrung habe, wollte ich mal fragen ob es eine Möglichkeit gibt, mittels des Ereignis Skripters in Kombination mit Proxys die 1 Free User Limits von Hostern zu umgehen? Der Gedanke ist, dass im Skript ein oder mehrere Hoster eingetragen werden können, ggf. später noch nachgetragen werden können. Ich weiß nicht, ob das nun ausgediente zippyshare script nicht schon einen großen Teil dessen inbeinhaltet? (Siehe Spoiler) Würde mich freuen wenn sich eine Qualifizierte Kraft das anschauen könnte ![]()
Spoiler:
Code:
var links = getAllDownloadLinks(); for (i = 0; i < links.length; i++) { var link = links[i]; if (link.isEnabled()) { if (link.getHost() == "zippyshare.com") { if (link.getStatus() == "Retry in 15 minutes" || link.getStatus() == "403 GEO-blocked" || link.getStatus() == "Blocked by Firewall, ISP") { link.setSkipped(true); sleep(1000); link.setSkipped(false); } } } }
Spoiler:
Code:
var refreshtime = "900"; // (e.g. 900s) var myCountries = ["GB", "DE", "FR"]; //Filterlist for countries var max_response_time = 1.5; //1.5 or higher (e.g. 2), 1 is too low var proxy_test = 1; //1=ON,0=OFF (very slow) var max_proxies = 0; //0=Unlimited var standard_filter = " \"filter\" : {\"type\" : \"WHITELIST\",\"entries\" : [ \"zippyshare.com\"]},"; //\"filter\" : null, var add_proxy = JSON.parse("{\"proxy\" : {\"username\" : null,\"password\" : null,\"port\" : 80,\"address\" : null,\"type\" : \"NONE\",\"preferNativeImplementation\" : false,\"resolveHostName\" : false,\"connectMethodPrefered\" : false},\"rangeRequestsSupported\" : true," + standard_filter + "\"pac\" : false,\"reconnectSupported\" : false,\"enabled\" : true}"); var filter = new Array(); var old_proxylist = []; var new_proxylist = ""; var settings = "org.jdownloader.updatev2.InternetConnectionSettings"; var storage = "cfg/org.jdownloader.settings.InternetConnectionSettings"; old_proxylist = callAPI("config", "get", settings, storage, "customproxylist"); if (IsValidname() || IsValidinterval() && ((Math.round(Date.now() / 1000) - getProperty("LastProxyUpdate", true)) >= refreshtime) && !getProperty("updatingProxy", true) || getProperty("updatingProxy", true)) { if (!getProperty("updatingProxy", true)) { setProperty("LastProxyUpdate", Math.round(Date.now() / 1000), true); } else { if (getProperty("updatingProxy", true)) { setProperty("updatingProxy", false, true); } } var html; try { html = getPage("https" + "://raw.githubusercontent.com/fate0/proxylist/master/proxy.list"); var lines = html.split("\n"); for (var key in old_proxylist) { if (old_proxylist.hasOwnProperty(key)) { if (old_proxylist[key].proxy.type == "DIRECT" || old_proxylist[key].proxy.type == "NONE" || old_proxylist[key].enabled == false) { if (new_proxylist == "") { new_proxylist += JSON.stringify(old_proxylist[key]); } else { new_proxylist += "," + JSON.stringify(old_proxylist[key]); } } } } var myBr = getBrowser(); for (var i = 0; i < lines.length; ++i) { if (IsValidJSONString(lines[i])) { var temp_JSON = JSON.parse(lines[i]); var add_proxy_new = add_proxy; add_proxy_new.proxy.type = temp_JSON.type.toUpperCase(); add_proxy_new.proxy.port = temp_JSON.port; add_proxy_new.proxy.address = temp_JSON.host; if (myCountries.indexOf(temp_JSON.country) > -1 || temp_JSON.response_time > max_response_time) { continue; //skip proxy } var errorcheck = 0; if (proxy_test == 1) { myBr.setProxy(temp_JSON.type + "://" + temp_JSON.host + ":" + temp_JSON.port); try { myBr.getPage("http://www.google.de/"); } catch (e) { errorcheck = 1; } } if (errorcheck == 0 && proxy_test == 1 || proxy_test != 1) { if (add_proxy_new.proxy.address && filter[temp_JSON.host] != true) { filter[temp_JSON.host] = true; if (new_proxylist == "") { new_proxylist += JSON.stringify(add_proxy_new); } else { new_proxylist += "," + JSON.stringify(add_proxy_new); } } } } if (i >= max_proxies && max_proxies > 0) { break; } } callAPI("config", "set", settings, storage, "customproxylist", "[" + new_proxylist + "]"); } catch (e) {} } function IsValidJSONString(str) { if (typeof str !== "string") { return false; } try { JSON.parse(str); } catch (e) { return false; } return true; } function IsValidname() { try { if (name == "Geoblocking: zippy") { return true; } } catch (e) { return false; } return true; } function IsValidinterval() { try { if (interval >= 10000) { return true; } } catch (e) { return false; } return true; } |
#2630
|
||||
|
||||
![]() Quote:
![]() Quote:
![]() Welche Besonderheit gibt es bei den gewünschten Hostern? Also wozu genau soll das Skript dienen? Quote:
Das Hauptproblem waren stets funktionierende Proxies zu haben, so mehr das Skript verwendet haben, so weniger funktionierte es weil fast alle versuchten die gleichen Proxies aus fragwürdiger Quelle zu nutzen. Quote:
![]()
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. ![]() |
#2631
|
|||
|
|||
![]() Quote:
Most of my investigations have led to JD hanging (even from within try blocks) and needing killing. Would it be a good idea to mandate a standard property for each plugin to contain list of available property keys? A comma-delimited text string would suffice, maybe call it "ToC"?. |
#2632
|
||||
|
||||
![]() Quote:
This would be part of the following feature set: https://board.jdownloader.org/showthread.php?t=90744 I recommend reading that thread and posting your suggestions there. However at this moment and in the forseeable future, you need to work with what is there: There is no list of each plugins' properties available so here is some ways on how to find them:
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#2633
|
||||
|
||||
![]()
@BlackRuffy
EventScripter Threads zusammengeführt.
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#2634
|
|||
|
|||
![]()
Hello!, here I am again :3, well this time I come to ask you if there is any script to move the downloaded files including the folder that was created by jdownloader by the packer rule to another place in my case my folder is set to the jdownloader path is this:
C:\Users\Alexpark242\Documents\MEGAsync Downloads\Raigo Oh I forgot to mention it, could it be the files downloaded from a specific website? Here I have the url of the web site: **External links are only visible to Support Staff**... and move them to this path: C:\Users\Alexpark242\Downloads\Downloads\Compressed Thank you!! In the event that it is not possible from the website, if not all the downloaded files have to be moved to that path, it also helps me a thousand thanks!! |
#2635
|
|||
|
|||
![]()
Hallo!
Ich kann leider nicht ganz nachvollziehen, warum das EventScripter Plugin bei mir einfach gar nicht funktionieren will. Ich möchte das Feature mit der InfoDatei nutzen, die nach dem Fertigstellen des Downloads erstellt werden soll. Dafür nutze ich das Example Script, Test Run und Test Compile funktionieren natürlich. Trigger steht auf "Paket fertiggestellt". Was ich bereits getan habe: - auf zwei verschiedenen Maschinen die völlig unterschiedlich sind getestet - mehrmals das Plugin und das Script neu installiert, aktiviert, JD neu gestartet etc - Logs zum EventScripter gecheckt, sind komplett leer. Was kann ich tun und wo kann ich ansetzen? Ich bin ziemlich ratlos, übersehe ich was? Danke schon mal für eure Hilfe! |
#2636
|
||||
|
||||
![]()
EventScripter Threads zusammengeführt.
@jaypie Bitte das genutzte Script in dein Post packen oder verlinken.
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#2637
|
|||
|
|||
![]()
@thecoder2012
Ich hätte es schon gern, dass die Proxy automatisch gesucht und zusammengefügt werden. Bin zum manuellen eintragne zu faul ![]()
Spoiler:
Quote:
|
#2638
|
|||
|
|||
![]()
Edit: Hier das Beispiel-Script, das ich nutze:
PHP Code:
Quote:
|
#2639
|
||||
|
||||
![]()
@jaypie
Du scheinst die Kommentare am Anfang des Scriptes nicht gelesen zu haben. Per default wird die Datei nur geschrieben, wenn das Paket ein Kommentar hat. Setze "iContent" auf irgendeinen Wert höher als 0 und das Infofile wird immer geschrieben. Ich habe das Script mal um "alerts" erweitert, sodass man es besser debuggen kann. Setze "debugdialogs" in der folgenden Version auf true und das Script wird an diversen Stellen Dialoge zeigen.
Spoiler:
Code:
/* Event Script: writeInfoFile Creates an Info-File into the DL-Folder with detailed information Version: 0.21 Requirements: Trigger "Package Finished" Tested: JD2 on Windows7-32bit Platform and jre8 (see path-creation code at the end of this script) */ //---------- Global declarations ----------------- var debugdialogs = false; if (debugdialogs == true) { alert('Debug: script started') } var sInfoFilePath = ""; //the target file, if already available, then APPENDING, else creation var sText = ""; //will be filled with content (or not :-) var sInfoFileType = ".info" //set path creation at the end of the script var iContent = 1; //setting bit 1 if pwd is available, setting bit 2 if comments available //if not set, no info file, set to > 0 to always write info file var myPackage = package; var aParts = myPackage.getDownloadLinks(); var aArchives = package.getArchives(); var bWriteFile = false; //---------- Building Info-Text ----------- if (myPackage.isFinished() == true) { bWriteFile = true; sText += "**********************************" + "\r\n" sText += "* P A C K A G E *" + "\r\n" sText += "**********************************" + "\r\n" sText += "Package.Name : " + myPackage.getName() + "\r\n" + "Package.DownloadFolder : " + myPackage.getDownloadFolder() + "\r\n" + "Package.Total : " + myPackage.getBytesTotal() + "\r\n" + "Package.Loaded : " + myPackage.getBytesLoaded() + "\r\n" + "Package.Finished : " + myPackage.isFinished() + "\r\n"; if (myPackage.getComment() != undefined) { sText += "Package.Comment : " + myPackage.getComment() + "\r\n"; iContent |= 2; } sText += "\r\n" sText += "**********************************" + "\r\n" sText += "* P A R T S *" + "\r\n" sText += "**********************************" + "\r\n" for (var i = 0; i < aParts.length; i++) { sText += "Part.# : " + i + "\r\n" + "Part.Name : " + aParts[i].getName() + "\r\n" + "Part.Status : " + aParts[i].getStatus() + "\r\n" + "Part.Enabled : " + aParts[i].isEnabled() + "\r\n" + "Part.Finished : " + aParts[i].isFinished() + "\r\n" + "Part.Skipped : " + aParts[i].isSkipped() + "\r\n" + "Part.ExtractionStatus : " + aParts[i].getExtractionStatus() + "\r\n" + "Part.Total : " + aParts[i].getBytesTotal() + "\r\n" + "Part.Loaded : " + aParts[i].getBytesLoaded() + "\r\n"; if (aParts[i].getUrl() != undefined) { sText += "Part.URL : " + aParts[i].getUrl() + "\r\n"; } if (aParts[i].getComment() != undefined) { sText += "Part.Comment : " + aParts[i].getComment() + "\r\n"; iContent |= 2; } var myArchive = aParts[i].getArchive(); if (myArchive != undefined) { if (myArchive.getUsedPassword() != undefined) { sText += "Part.UsedPassword : " + myArchive.getUsedPassword() + "\r\n"; iContent |= 1; } } sText += "--------------------------:-" + "\r\n" } sText += "\r\n" sText += "**********************************" + "\r\n" sText += "* A R C H I V E S *" + "\r\n" sText += "**********************************" + "\r\n" for (var i = 0; i < aArchives.length; i++) { sText += "Archive.# : " + i + "\r\n" + "Archive.Name : " + aArchives[i].getName() + "\r\n" + "Archive.ArchiveTyp : " + aArchives[i].getArchiveType() + "\r\n"; if (aArchives[i].getInfo() != undefined) { sText += "Package.Archive.Info : "; sText += JSON.stringify(aArchives[i].getInfo(), null, 2) + "\r\n"; } sText += "--------------------------:-" + "\r\n" } } //---------- INFO.FILE naming and writing ----------- var fileWritten = false; if (bWriteFile == true && iContent > 0) { //comment out or set "iContent >= 0" if info-file should be written always //- path creation sInfoFileType = "." + iContent + sInfoFileType //add content-type hint to filetype sInfoFilePath = myPackage.getDownloadFolder() + "/" + myPackage.getName() + sInfoFileType; //<packageFolder>/<packageName>.<iContent>.info if (sInfoFilePath.length > 255) { //path to long! -> shorten!! sInfoFilePath = myPackage.getDownloadFolder() + "/jd" + sInfoFileType; //<packageFolder>/jd.<iContent>.info } //- writing try { writeFile(sInfoFilePath, sText, true); fileWritten = true; } catch (e) { //no error handling implemented ! if (debugdialogs == true) { alert('Debug: Script failure | Failed to write to path: ' + sInfoFilePath) } } } if (debugdialogs == true) { if (bWriteFile == true) { alert('Debug: Script success | Packagename: ' + myPackage.getName() + ' | fileWritten=' + fileWritten + ' | Path: ' + sInfoFilePath) } else { alert('Debug: Script fail | Wrong trigger or test-execution?!') } } Bei mir funktionierte das Script einwandfrei!
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA |
#2640
|
||||
|
||||
![]() Quote:
![]() Ich weiß nicht, inwiefern das Script was hier mal rumflog noch funktioniert. Wie im Forum schon mehrfach geschrieben halte ich von der Verwendung dutzender Free Proxies nicht: Fehleranfällig, instabil, langsam! Da würde ich mir lieber einen premium Account kaufen (diese Aussage hat keinen Werbehintergrund). Dies ist jedoch nur meine Meinung. Wenn man genug Zeit und/oder sogar Spaß an sowas hat, kann man sich natürlich an eine Lösung setzen.
__________________
JD Supporter, Plugin Dev. & Community Manager Erste Schritte & Tutorials || JDownloader 2 Setup Download ----------------------------------- On Vacation / Im Urlaub Start: 2023-12-09 End: TBA Last edited by pspzockerscene; 22.06.2023 at 13:23. Reason: Tippfehler fixed |
![]() |
Thread Tools | |
Display Modes | |
|
|