From 0c08d40a703ec4b4e377a8bb3decf0227b43ab3a Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Fri, 17 Nov 2023 21:14:43 +0100 Subject: Update post naming scheme Make naming scheme always include date in the URL. Also update existing post title to better fit the new naming scheme requirements. --- .../2023-11-15-scraping-images-from-open-tabs.md | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 content/2023-11-15-scraping-images-from-open-tabs.md (limited to 'content/2023-11-15-scraping-images-from-open-tabs.md') diff --git a/content/2023-11-15-scraping-images-from-open-tabs.md b/content/2023-11-15-scraping-images-from-open-tabs.md new file mode 100644 index 0000000..271d975 --- /dev/null +++ b/content/2023-11-15-scraping-images-from-open-tabs.md @@ -0,0 +1,25 @@ ++++ +title = "Scraping images from open tabs" +date = "2023-11-15" +updated = "2023-11-15" ++++ +```zsh +cat export.json \ + | jaq --raw-output '..["url"]? | strings' \ + | rg --fixed-strings "wallhaven.cc/w" \ + | gallery-dl --input-file - +``` +I exported my current session to json with tab session manager. This command +takes that json export (referred to as `export.json`), finds all the urls +that contain `wallhaven.cc/w` (i.e. all urls that are wallhaven images) and +passes them to gallery-dl. Gallery-dl then neatly downloads all of those images +in their original quality. + +This workflow could be made better by creating a version of tab session manager +that exports in a simpler (or more configurable format), and I could also turn +this into a script that takes the wanted website formats as an argument. +Invocation of the script might look something like: +```zsh +tabsession-dl --format "wallhaven.cc/w" --format "reddit.com/r" \ + --input-file export.json +``` -- cgit v1.3.1