Skip to content

Commit

Permalink
Add ability to retrieve whether or not a given video was deleted by h…
Browse files Browse the repository at this point in the history
…is uploader, solving https://stackoverflow.com/q/74168274
  • Loading branch information
Benjamin-Loison committed Oct 24, 2022
1 parent 9560baa commit 899316c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
function getJSONFunc($rawData, $music = false)
{
$headers = [
"Content-Type: application/json"
"Content-Type: application/json",
'Accept-Language: en'
];
if ($music) {
array_push($headers, 'Referer: https://music.youtube.com');
Expand Down Expand Up @@ -84,7 +85,8 @@ function getItem($id)

if ($options['status']) {
$status = [
'embeddable' => $result['playabilityStatus']['status'] === 'OK'
'embeddable' => $result['playabilityStatus']['status'] === 'OK',
'removedByTheUploader' => $result['playabilityStatus']['errorScreen']['playerErrorMessageRenderer']['subreason']['runs'][0]['text'] === 'This video has been removed by the uploader'
];
$item['status'] = $status;
}
Expand Down

0 comments on commit 899316c

Please sign in to comment.