http://www.lostfilm.tv/download.php/2035/Lost.s06e07.rus.PROPER.LostFilm.TV.torrent
<item>
<title>The 3 Great Tenors - VA / Classic / 2002 / MP3 / 320 kbps</title>
<description>: - </description>
<link>http://kinozal.tv/details.php?id=546381</link>
</item>
http://kinozal.tv/rss.xml
and grep
'om choose the distribution of interest to us according to the description:
curl -s http://kinozal.tv/rss.xml | grep -iA 2 'MP3'
-s
" is an indication to "be quiet",
-i
" is case-insensitive search,
-A 2
" - tells grep along with the found string to output two more following it (it is in them that the link of interest is contained)
grep
'and leave only the links:
grep -ioe 'http.*[0-9]'
for i in ... ; do ... ; done
`...`
substitute the two results of our previous surveys:
for i in `curl -s http://kinozal.tv/rss.xml | grep -iA 2 'MP3' | grep -ioe 'http.*[0-9]'`; do ... ; done
grep
'we pull out a link to the torrent file from it:
curl -sb "uid=***; pass=***; countrys=ua" $i | grep -m 1 -ioe 'download.*\.torrent'
-b "uid=***; pass=***; countrys=ua"
-b "uid=***; pass=***; countrys=ua"
-b "uid=***; pass=***; countrys=ua"
" - option to set the transmitted cookies with authorization information,
-m 1
" - leaves only the first of two direct links to the torrent file (yes, the link to the same file is found twice on the cinema distribution pages)
wget
'om:
wget -nc -qi - -B "http://kinozal.tv/" -P ~/.config/watch_dir --header "Cookie: uid=***; pass=***; countrys=ua"
-B "http://kinozal.tv/"
" - setting the prefix / domain for downloading relative links (namely, they are on the pages of the movie distribution descriptions),
--header "Cookie: uid=***; pass=***; countrys=ua"
--header "Cookie: uid=***; pass=***; countrys=ua"
--header "Cookie: uid=***; pass=***; countrys=ua"
" - setting the header for the GET request (this time I wanted to transfer cookies in this way and not through the file :))
for i in `curl -s http://kinozal.tv/rss.xml | grep -iA 2 'mp3' | grep -ioe 'http.*[0-9]'`; do curl -sb "uid=***; pass=***; countrys=ua" $i | grep -m 1 -ioe 'download.*\.torrent' | wget -nc -qi - -B "http://kinozal.tv/" -P ~/.config/watch_dir --header "Cookie: uid=***; pass=***; countrys=ua"; done
cron
:
*/15 * * * * > /dev/null 2>&1
head -1
" with the grep
" -m 1
" option.Source: https://habr.com/ru/post/87166/