Grabbing images

A place for developers to advertise their TheTVDB.com enabled app and get help from other developers with the API.
Forum rules
This forum is now read-only. Support for TheTVDB.com is now available at https://support.thetvdb.com/
Locked
Tracy
Posts: 25
Joined: Wed Oct 24, 2018 2:16 pm
Location: Brighton, UK

Wed Oct 24, 2018 3:13 pm

Hi All

I'm trying to download a banner for a series using the latest api and am not getting very far. I'm using CURL but the file I'm getting is actually a 404 html file with an image name.

This is the code I'm using, can anyone tell me the problem?

Code: Select all

			$ch = curl_init('https://www.thetvdb.com/artwork/1313525');
			$fp = fopen($seriesBanner, 'wb');
			curl_setopt($ch, CURLOPT_FILE, $fp);
			$headers= array('Accept: image/jpeg','Content-Type: image/jpeg','Authorization: Bearer ' . $serverToken);
			curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
			curl_setopt($ch, CURLOPT_POST,0);
			curl_exec($ch);
			curl_close($ch);
			fclose($fp);
Locked