Skip to content

Instantly share code, notes, and snippets.

@biaocy
Last active August 19, 2018 06:39
Show Gist options
  • Save biaocy/03af6c1e8620e024c666d9cbb69c63ac to your computer and use it in GitHub Desktop.
Save biaocy/03af6c1e8620e024c666d9cbb69c63ac to your computer and use it in GitHub Desktop.
extract download url from zimuzu rss
#!/bin/bash
#zimuzu video id
vid="$1"
#season: S01 etc
season="$2"
#output file name
fname="${3-$vid}.$season.`date +%Y%m%d`.json"
curl "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%27http%3A%2F%2Fdiaodiaode.me%2Frss%2Ffeed%2F$vid%27&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -H 'authority: query.yahooapis.com' -H 'cache-control: max-age=0' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/68.0.3440.75 Chrome/68.0.3440.75 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7,ja;q=0.6,de;q=0.5,ar;q=0.4,fr;q=0.3,ko;q=0.2,es;q=0.1' --compressed | jq "[ .query.results.item[] | select(.title | contains(\"$season\")) ]" > $fname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment