From 2380c5a1b7991f8b2800fcaddeef4f41074727be Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 15 May 2023 23:57:01 +0200 Subject: removed y2chid, updated y2feed --- bin/common/y2chid | 7 ------- bin/common/y2feed | 13 +++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) delete mode 100755 bin/common/y2chid (limited to 'bin/common') 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..8d2f9d9 100755 --- a/bin/common/y2feed +++ b/bin/common/y2feed @@ -1,8 +1,9 @@ -#!/usr/bin/env sh +#!/bin/sh +ua="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" -test -z "${url:=$1}" \ - && url="$(cat /dev/stdin)" +test -z "${url:=$1}" && + url="$(cat /dev/stdin)" -echo "url: ${url}" 1>&2 - -curl -s "$url" | pup 'link attr{href}' | grep 'feeds' +echo "url: $url" >&2 +curl -s -H "$ua" "$url"| + pup 'link[title=RSS] attr{href}' -- cgit v1.2.3 From f437dee2bec320fcbab0c0aba45a50976d565ee8 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 May 2023 00:49:56 +0200 Subject: added user-agent generation and fixed curl command --- bin/common/y2feed | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bin/common') diff --git a/bin/common/y2feed b/bin/common/y2feed index 8d2f9d9..196ecb7 100755 --- a/bin/common/y2feed +++ b/bin/common/y2feed @@ -1,9 +1,12 @@ #!/bin/sh -ua="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" +ua="$(yt-dlp --dump-user-agent)" test -z "${url:=$1}" && url="$(cat /dev/stdin)" +url="http://youtube.com/$(echo "$url" | + awk -F '/' '{print $NF}')" echo "url: $url" >&2 -curl -s -H "$ua" "$url"| + +curl -L -s -H "$ua" "$url" | pup 'link[title=RSS] attr{href}' -- cgit v1.2.3