diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-06-18 23:05:23 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-06-18 23:05:23 +0200 |
commit | 11ee207cc10e72aa96fad4715b14a84c686ad480 (patch) | |
tree | bc98d60bb59ab0fdc183c6673fe8fe143fd367bc /bin/common | |
parent | 305c8e8ff1fc4a76fb42151105e119e8266df57c (diff) | |
parent | 8c5d85923a970bd60657848e1c2c6f627c4329d9 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/common')
-rwxr-xr-x | bin/common/y2chid | 7 | ||||
-rwxr-xr-x | bin/common/y2feed | 14 |
2 files changed, 9 insertions, 12 deletions
diff --git a/bin/common/y2chid b/bin/common/y2chid deleted file mode 100755 index 68ba6bc..0000000 --- a/bin/common/y2chid +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -test -z "${chidot:=$1}" \ - && chidot="$(cat /dev/stdin)" - -echo "chidot: ${chidot}" 1>&2 -curl -s "https://www.youtube.com/${chidot}/"| pup 'meta[itemprop="channelId"] attr{content}' diff --git a/bin/common/y2feed b/bin/common/y2feed index 0f27d68..196ecb7 100755 --- a/bin/common/y2feed +++ b/bin/common/y2feed @@ -1,8 +1,12 @@ -#!/usr/bin/env sh +#!/bin/sh +ua="$(yt-dlp --dump-user-agent)" -test -z "${url:=$1}" \ - && url="$(cat /dev/stdin)" +test -z "${url:=$1}" && + url="$(cat /dev/stdin)" -echo "url: ${url}" 1>&2 +url="http://youtube.com/$(echo "$url" | + awk -F '/' '{print $NF}')" +echo "url: $url" >&2 -curl -s "$url" | pup 'link attr{href}' | grep 'feeds' +curl -L -s -H "$ua" "$url" | + pup 'link[title=RSS] attr{href}' |