Skip to content

Commit

Permalink
Merge pull request #131 from daniel-zahariev/master
Browse files Browse the repository at this point in the history
Fix report downloading in PHP example #70
  • Loading branch information
AndyDiamondstein committed Aug 16, 2017
2 parents 720dc5c + 51ee114 commit 170530f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions php/retrieve_reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ function downloadReport(Google_Service_YouTubeReporting $youtubeReporting, $repo
$client->setDefer(true);

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

file_put_contents("reportFile", $response->getResponseBody());
file_put_contents("reportFile", $response->getBody());
$client->setDefer(false);
}
?>
Expand Down

0 comments on commit 170530f

Please sign in to comment.