LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 07-19-2017, 01:56 PM   #1
alielkamel
LQ Newbie
 
Registered: Jul 2017
Posts: 12

Rep: Reputation: Disabled
Please Help : Curl/Wget with Kodi -- 403 Forbidden code returned


Hi ,
Please i need your help ,
I wrote a script that allows me to use CURL to have information on streaming links. I managed to write the script for the streaming links that are hosted in the streaming website, and I was able to get the information from the servers (the links are: URL/File.mp4 , Also I use the command WGET when I want to download the link.
My problem is: how to use CURL or WGET to get a response that the link exists and it is valid in the server like this link: ( i got the links from KODI )
I mean that i want to use CURL or WGET with kodi links to get information from the server
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

Also i tried : wget -a --spider url --> i receive a 8 code returned

The Script that i use :
Code:

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
 
Old 07-20-2017, 08:03 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Dupe reported.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Curl/Wget with Kodi -- 403 Forbidden code returned alielkamel Linux - Software 16 07-23-2017 10:43 AM
wget - using --user-agent option still results in 403/forbidden error tensigh Linux - Software 14 01-21-2013 12:48 PM
wget ERROR 403: Forbidden markm0705 Linux - Newbie 3 05-08-2011 05:47 PM
Wget or cURL code for checking changes to a web page? ewingtux Programming 2 12-16-2008 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration