Skip to content

Commit 170530f

Browse files
Merge pull request youtube#131 from daniel-zahariev/master
Fix report downloading in PHP example youtube#70
2 parents 720dc5c + 51ee114 commit 170530f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

php/retrieve_reports.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ function downloadReport(Google_Service_YouTubeReporting $youtubeReporting, $repo
167167
$client->setDefer(true);
168168

169169
// Call the YouTube Reporting API's media.download method to download a report.
170-
$request = $youtubeReporting->media->download("");
171-
$request->setUrl($reportUrl);
170+
$request = $youtubeReporting->media->download("", array("alt" => "media"));
171+
$request = $request->withUri(new \GuzzleHttp\Psr7\Uri($reportUrl));
172172
$response = $client->execute($request);
173173

174-
file_put_contents("reportFile", $response->getResponseBody());
174+
file_put_contents("reportFile", $response->getBody());
175175
$client->setDefer(false);
176176
}
177177
?>

0 commit comments

Comments
 (0)