Sponsored Content
Top Forums Shell Programming and Scripting Need Help Please ! Curl + KODI agent ? Post 303000773 by alielkamel on Wednesday 19th of July 2017 01:00:11 PM
Old 07-19-2017
thank you very much .
i used it and i have a 8 in return code .
The purpose of the request is how to prove that the link exists. With the curl command, I have a forbidden return 403 while the link is functional via kodi. Here is my script and example of a link for example :

*URL -->http:// dittotv.live-s.cdn.bitgravity .com /cdn-live/_definst_/dittotv/ secure/zee_cinema_hd_Web.smil/ playlist.m3u8

Script :
Code:
#!/bin/bash
declare ans2=Y;
while [ $ans2 = "Y" ];
do
read -p "URL to check: " url
if curl -v -i --output /dev/null --silent --fail "$url"; then
  printf  "$url --> The link exist !!:"
else
  printf "$url --> The link does not exist !!"
fi
printf 'Want you show the cURL information from the Streaming Link? (Y/N/Q):'
read -p " Your Answer :" ans
if [ $ans = "Q" ]; then 
exit 
fi
if [ $ans = "Y" ]; then curl -v -i "$url"
else printf 'OK ! No Prob ! -->  Next Question:' 
fi
printf 'Want You download the streaming video from the streaming server? (Y/N/Q):'
read -p "(Y/N/Q):" ans3
if [ $ans3 = "Q" ]; then 
exit 
fi
while [ $ans3 = "Y" ]
do
if curl --output /dev/null --silent --head --fail "$url"; then
wget "$url"
else 
printf "$red" 'The link is Down ! No file to download'
fi
exit
done
if [ $ans3 = "N" ]; then
printf 'OK ! No Prob ! -->  Next Question:'
fi
printf 'Want You check another URL ? (Y/N):'
read -p "(Y/N):" ans2
if [ $ans2 = "N" ] ; then 
printf "$red" "Good Bye - Thank you !!"
fi
done


Last edited by alielkamel; 07-19-2017 at 02:48 PM..
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

./agent for Backup Exec

Does anyone know how to run " ./agent.be & " in the background? I need to keep it running so that Backup Exec can see it. When I log out as root is shuts down the agent. This just started happening after I upgraded my Veritas drivers on my Windows 2000 server. That is my backup server. Hope... (1 Reply)
Discussion started by: jback
1 Replies

2. UNIX for Dummies Questions & Answers

Solaris agent

Hello, on Solaris 5.8 I've installed SunMgtCenter to get the time agent; it's under /opt/SUNWsymon/sbin/es-start -a it's in ps -ef | grep agent ...but it doesn't work; the machine is always in alarm cause the time is different of the clock server; is it clear enough ? tks cc (0 Replies)
Discussion started by: Carmen123
0 Replies

3. IP Networking

SNMP agent

Hi, I am really new in linux and SNMP. I have a SNMP agent in Linux (net-snmp). I have my MIB in the /usr/share/mibs directory, and I didn't manage to understand where and how do I put the values of the fields in the MIB? The values are static, so the agent need to return the same value in... (0 Replies)
Discussion started by: linuxbegginer
0 Replies

4. UNIX for Dummies Questions & Answers

perform agent

Hi, Please can someone explain me about the " perform agent " on UNIX . Thanx (1 Reply)
Discussion started by: reply2soumya
1 Replies

5. UNIX for Dummies Questions & Answers

vcs agent

Hi all, I'm new to vcs. I have a doubt. I need to know, what will happen if an agent is stopped while reources being online. Eg.. while the oracle agent is stopped, will all the oracle resources will become offline.. Advanced thanks (1 Reply)
Discussion started by: sunshine12
1 Replies
URI::URL(3)						User Contributed Perl Documentation					       URI::URL(3)

NAME
URI::URL - Uniform Resource Locators SYNOPSIS
$u1 = URI::URL->new($str, $base); $u2 = $u1->abs; DESCRIPTION
This module is provided for backwards compatibility with modules that depend on the interface provided by the "URI::URL" class that used to be distributed with the libwww-perl library. The following differences exist compared to the "URI" class interface: o The URI::URL module exports the url() function as an alternate constructor interface. o The constructor takes an optional $base argument. The "URI::URL" class is a subclass of "URI::WithBase". o The URI::URL->newlocal class method is the same as URI::file->new_abs. o URI::URL::strict(1) o $url->print_on method o $url->crack method o $url->full_path: same as ($uri->abs_path || "/") o $url->netloc: same as $uri->authority o $url->epath, $url->equery: same as $uri->path, $uri->query o $url->path and $url->query pass unescaped strings. o $url->path_components: same as $uri->path_segments (if you don't consider path segment parameters) o $url->params and $url->eparams methods o $url->base method. See URI::WithBase. o $url->abs and $url->rel have an optional $base argument. See URI::WithBase. o $url->frag: same as $uri->fragment o $url->keywords: same as $uri->query_keywords o $url->localpath and friends map to $uri->file. o $url->address and $url->encoded822addr: same as $uri->to for mailto URI o $url->groupart method for news URI o $url->article: same as $uri->message SEE ALSO
URI, URI::WithBase COPYRIGHT
Copyright 1998-2000 Gisle Aas. perl v5.18.2 2012-02-11 URI::URL(3)
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy