### AJAX Request Setup Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Configures default AJAX settings, including URL, method, data types, and content type. Use `ajaxSetup` to modify these defaults globally. ```javascript S.ajaxSetup=function(e,t){ return Ft(Ft(e,S.ajaxSettings),t) } ``` -------------------------------- ### Download a VOD using TwitchDownloaderCLI Source: https://github.com/lay295/twitchdownloader/blob/master/README.md Example command to download a VOD using its ID and specify an output file. Replace with the actual VOD ID. ```bash ./TwitchDownloaderCLI videodownload --id -o out.mp4 ``` -------------------------------- ### Download FFmpeg using TwitchDownloaderCLI Source: https://github.com/lay295/twitchdownloader/blob/master/README.md Use the TwitchDownloaderCLI to automatically download the FFmpeg executable. This is an alternative to manual installation. ```shell TwitchDownloaderCLI.exe ffmpeg --download ``` -------------------------------- ### Render Chat with Custom Settings Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCLI/README.md Render a chat log into a video with custom resolution, framerate, and message outline settings. Ensure FFmpeg is installed and configured. ```bash ./TwitchDownloaderCLI chatrender -i chat.json -h 1440 -w 720 --framerate 60 --outline -o chat.mp4 ``` -------------------------------- ### jQuery GET and POST Helpers Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Shorthand methods for making GET and POST requests. `jQuery.get` is a shortcut for `jQuery.ajax` with method 'GET', and `jQuery.post` is a shortcut for 'POST'. ```javascript jQuery.each(["get", "post"], function(e, i) { jQuery[i] = function(e, t, n, r) { return m(t) && (r = r || n, n = t, t = void 0), S.ajax(S.extend({ url: e, type: i, dataType: r, data: t, success: n }, S.isPlainObject(e) && e)) } }) ``` -------------------------------- ### Download FFmpeg using TwitchDownloaderCLI Source: https://github.com/lay295/twitchdownloader/blob/master/README.md Use TwitchDownloaderCLI to download the FFmpeg executable if it's not already installed. This is often required for video processing. ```bash ./TwitchDownloaderCLI ffmpeg --download ``` -------------------------------- ### Get Modal Configuration Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Merges default options with provided configuration and performs type checking. Use this to get the validated configuration object. ```javascript p._getConfig=function(t){return t=r({},a,t),P.typeCheckConfig(e,t,l),t} ``` -------------------------------- ### Flexible Pagination Initialization Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Initializes a flexible pagination component on a container element. This setup includes options for controlling the number of items per page, search functionality, and custom CSS classes for pagination buttons. ```javascript let flexiblePagination = $('#content').flexiblePagination({ pagingControlsContainer: "#pagingControls", pagingContainer: "#content", itemSelector: ".comment-root:visible", itemsPerPageSelector: ".itemPerPageDropDown", /* Paragraphs Per Page */ searchBoxSelector: '.searchBox', itemsPerPage: 100, currentPage: 1, css: { btnNumberingClass: "btn btn-sm btn-primary", btnActiveClass: "btn btn-sm btn-secondary" }, }); ``` -------------------------------- ### Force Update Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCLI/README.md Check for newer versions of TwitchDownloaderCLI and immediately download and install it if an update is available. The `--force` flag ensures the check and download occur. ```bash ./TwitchDownloaderCLI update --force ``` -------------------------------- ### Tooltip Event Listener Setup Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Sets up event listeners for showing and hiding tooltips based on the configured trigger events (e.g., 'click', 'hover', 'focus'). It also handles closing tooltips when a parent modal is hidden. ```javascript I._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==C){var i=n===E?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,s=n===E?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(s,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()} ``` -------------------------------- ### Event Delegation Setup in jQuery Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Sets up event delegation for events that bubble up the DOM tree. This is efficient for handling events on dynamically added elements. ```javascript function Se(e, i, o) { o ? (Y.set(e, i, !1), S.event.add(e, i, { namespace: !1, handler: function(e) { var t, n, r = Y.get(this, i); if (1 & e.isTrigger && this[i]) { if (r.length) (S.event.special[i] || {}).delegateType && e.stopPropagation(); else if (r = s.call(arguments), Y.set(this, i, r), t = o(this, i), this[i](), r !== (n = Y.get(this, i)) || t ? Y.set(this, i, !1) : n = {}, r !== n) return e.stopImmediatePropagation(), e.preventDefault(), n && n.value } else r.length && (Y.set(this, i, { value: S.event.trigger(S.extend(r[0], S.Event.prototype), r.slice(1), this) }), e.stopImmediatePropagation()) } })) : void 0 === Y.get(e, i) && S.event.add(e, i, we) } ``` -------------------------------- ### Run zsh under Rosetta 2 (macOS Apple Silicon) Source: https://github.com/lay295/twitchdownloader/blob/master/README.md Command to start a zsh terminal session under Rosetta 2 emulation. This is necessary to run x64 binaries on Apple Silicon Macs if not using the arm64 version. ```bash arch -x86_64 zsh ``` -------------------------------- ### Display Help Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCLI/README.md Print the available operations for TwitchDownloaderCLI. This is a general help command to see all possible actions. ```bash ./TwitchDownloaderCLI help ``` -------------------------------- ### Navigate to GUI Build Folder Source: https://github.com/lay295/twitchdownloader/blob/master/README.md Change directory to the publish output folder for the TwitchDownloaderWPF application on Windows x64. ```bash cd TwitchDownloaderWPF/bin/Release/net10.0-windows/publish/win-x64 ``` -------------------------------- ### Scrollspy Get Config Method Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Gets and validates the configuration for the scrollspy. Ensures the target is a valid selector and merges with default options. ```javascript g._getConfig=function(n){if("string"!=typeof(n=r({},a,n)).target){var i=t(n.target).attr("id");i||(i=P.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return P.typeCheckConfig(e,n,l),n} ``` -------------------------------- ### Display VOD Downloader Help Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCLI/README.md Print the available options specifically for the VOD downloader. Use this to see all parameters for downloading VODs. ```bash ./TwitchDownloaderCLI videodownload --help ``` -------------------------------- ### Scrollspy Get Offset Height Method Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Gets the visible height of the scroll element. Returns window height if the scroll element is the window, otherwise the element's bounding client rect height. ```javascript g._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height} ``` -------------------------------- ### Build TwitchDownloader CLI Source: https://github.com/lay295/twitchdownloader/blob/master/README.md Publish the TwitchDownloaderCLI project. Replace with the desired target platform (e.g., Windows, Linux, MacOS). ```bash dotnet publish TwitchDownloaderCLI -p:PublishProfile= ``` -------------------------------- ### Navigate to TwitchDownloader Solution Folder Source: https://github.com/lay295/twitchdownloader/blob/master/README.md Change the current directory to the root of the cloned TwitchDownloader repository. This is where the solution file is located. ```bash cd TwitchDownloader ``` -------------------------------- ### Get and Set CSS Properties with jQuery Source: https://github.com/lay295/twitchdownloader/blob/master/TwitchDownloaderCore/Resources/chat-template.html Use the .css() method to get or set CSS properties for elements. It accepts a property name and value, or an object of properties and values. For multiple properties, it returns an object. ```javascript S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a>",a.btnNextText=">",a.btnPreviousText="<",a.css={},a.css.paginationLayout="