Saturday, 5 November 2022

Download entire website with wget or httrack

Before I used to run HTTrack (Windows, GUI version), but most of the time it wasn't what I wanted.

Here is a complete wget solution:

wget -r --no-parent --mirror --page-requisites --adjust-extension --convert-links --continue -e robots=off  https://www.website.com/

UPD: Yet, after a while, that was still isn't what I wanted :) I needed to crawl all pages which only belong to this website's domain PLUS the files like PDF the website references which are outside of site's domain. WGET won't give you this. HTTRACK in its CONSOLE incarnation, however, does. Here is the solution:

httrack --near -u2 -p7 https://YOUR_SITE

Note, it's GUI version won't do! Moreover, I found no switch in its GUI where these flags could be activated, same as no place to add cmd prompt flags manually.

Saturday, 29 October 2022

Download a youtube playlist

 Put ffmpeg.exe and yt-dlp (latest versions) to the folder where files to be downloaded.

The following command will download a playlist ${YOUR_PLAYLIST} in a subfolder with its reference name, enumerating the videos as they are ordered in the list, and assigning their names to the files. Numeration will start with 01 and with the oldest video. We need this to be able to keep the numeration later when we update the contents. The file archive.txt is needed to track the update and only download what hasn't been downloaded yet.

yt-dlp --format "bestvideo[height<=4k]+bestaudio/best" https://www.youtube.com/${YOUR_PLAYLIST} --embed-thumbnail --add-metadata --parse-metadata "description:(?s)(?P<webpage_url>.+)" --playlist-reverse --download-archive _archive --write-auto-sub --sub-langs "en,ru" -o "%%(playlist_index)s - %%(title)s - %%(id)s.%%(ext)s" --compat-option playlist-index


Wednesday, 29 June 2022

Simple solution for ThinkPad TrackPoint drift

TL;DR: To get rid of the drift, replace your TrackPoint cap with a fresh one that really fits your laptop model. Get a pack of caps on Amazon or ebay (P/N 4XH0L55146 might be a fit). Even if you own a brand-new laptop and have never changed the red cap yourself, try changing it, as the manufacturer might have confused the parts or use the cap which are slightly misaligned.

I'm a heavy IBM/Lenovo ThinkPad-s user over a span of the last 15 years: T61, x120e, W520 2x, T430s, T460p, x1, and lastly – x1 Extreme. The only one which had a famous TrackPoint drift is x1 Extreme. I've been using it since September 2018 – almost 4 years by now, and though I really liked it, the drift made my experience vastly unfortunate. I've actually abandoned using TrackPoint, so painful this was. I've made many attempts to fix it (more on this later).

Thus, it was even more to my surprise that I've found a very simple solution to a TrackPoint drift problem.