1

There is an answer that describes how to fetch all videos from a YouTube channel here. However, in many cases, the parent account is not a channel per se, but something similar (like this is a channel, as evidenced by the "channel" word in the URL, while this one is not, since it has a keyword "c" in the URL, and not "channel"). I can still get playlists from it, and get all videos from individual playlist in that WWE account, but there are many videos in that account that are not part of any playlist listed in the account, like this).

Question - Is there a way to get all videos from an account, not just a channel or a playlist? Or is there any way to get default playlist/channel from an account where all unlisted videos such as above can be found?

SexyBeast
  • 7,913
  • 28
  • 108
  • 196
  • Please see answer posted here: https://stackoverflow.com/questions/18953499/youtube-api-to-fetch-all-videos-on-a-channel which shows HOW to get the ChannelID which is often not available by default and can then be used to get the video uploads. – Antony Apr 26 '23 at 10:37

1 Answers1

2

Edit (15/03/2022):

I've found that the video_id = eJjbnFZ6yA8 is on the "uploads" playlist and it's in the position # 7765.

You can try to get the position in the given playlist by making this query:

https://content-youtube.googleapis.com/youtube/v3/playlistItems?maxResults=50&playlistId=<UPLOADS_PLAYLIST_ID>&videoId=<VIDEO_ID_YOU_WANT_TO_GET>&part=id,snippet,contentDetails,status&key=[YOUR_API_KEY]

These are the results of the video_id = eJjbnFZ6yA8:

URL:

https://content-youtube.googleapis.com/youtube/v3/playlistItems?maxResults=50&playlistId=UUJ5v_MCY6GNUBTO8-D3XoAg&videoId=eJjbnFZ6yA8&key=[YOUR_API_KEY]&part=id,snippet,contentDetails,status

Response:

{
    "kind": "youtube#playlistItemListResponse",
    "etag": "SyO-_mevTIc8xX7G8QA0JKcgwTE",
    "items": [
        {
            "kind": "youtube#playlistItem",
            "etag": "70IgC85z_68I9jCkp4Jwuwo_pO8",
            "id": "VVVKNXZfTUNZNkdOVUJUTzgtRDNYb0FnLmVKamJuRlo2eUE4",
            "snippet": {
                "publishedAt": "2020-12-27T21:05:54Z",
                "channelId": "UCJ5v_MCY6GNUBTO8-D3XoAg",
                "title": "FULL MATCH - The Rock vs. Mankind – WWE Championship Match: Raw, Jan. 4, 1999",
                "description": "Mankind looks to make his dream come true when he challenges The Rock for the WWE Championship on the first Raw of 1999: Courtesy of WWE Network.\nWWE Network | Subscribe now: http://wwe.yt/wwenetwork\r\n---------------------------------------------------------------------\r\nFollow WWE on YouTube for more exciting action!\r\n---------------------------------------------------------------------\r\nSubscribe to WWE on YouTube: http://wwe.yt/\r\nCheck out WWE.com for news and updates: http://goo[.]gl/akf0J4\r\nWatch WWE on Sony in India: http://www.wwe.com/SonySportsNetwork\r\nFind the latest Superstar gear at WWEShop: http://shop.wwe.com\r\n---------------------------------------------\r\nCheck out our other channels!\r\n---------------------------------------------\r\nThe Bella Twins: https://www.youtube.com/thebellatwins\r\nUpUpDownDown: https://www.youtube.com/upupdowndown\r\nWWEMusic: https://www.youtube.com/wwemusic\r\nTotal Divas: https://www.youtube.com/wwetotaldivas\r\n------------------------------------\r\nWWE on Social Media\r\n------------------------------------\r\nTwitter: https://twitter.com/wwe\r\nFacebook: https://www.facebook.com/wwe\r\nInstagram: https://www.instagram.com/wwe/\r\nReddit: https://www.reddit.com/user/RealWWE\r\nGiphy: https://giphy.com/wwe\r\n------------------------------------\r\nWWE Podcasts\r\n------------------------------------\r\nAfter the Bell with Corey Graves: https://wwe.com/afterthebell\r\nThe New Day: Feel the Power: https://wwe.com/feelthepower\r\nUncool with Alexa Bliss: https://wwe.com/uncoolwithalexa",
                "thumbnails": {
                    "default": {
                        "url": "https://i.ytimg.com/vi/eJjbnFZ6yA8/default.jpg",
                        "width": 120,
                        "height": 90
                    },
                    "medium": {
                        "url": "https://i.ytimg.com/vi/eJjbnFZ6yA8/mqdefault.jpg",
                        "width": 320,
                        "height": 180
                    },
                    "high": {
                        "url": "https://i.ytimg.com/vi/eJjbnFZ6yA8/hqdefault.jpg",
                        "width": 480,
                        "height": 360
                    },
                    "standard": {
                        "url": "https://i.ytimg.com/vi/eJjbnFZ6yA8/sddefault.jpg",
                        "width": 640,
                        "height": 480
                    },
                    "maxres": {
                        "url": "https://i.ytimg.com/vi/eJjbnFZ6yA8/maxresdefault.jpg",
                        "width": 1280,
                        "height": 720
                    }
                },
                "channelTitle": "WWE",
                "playlistId": "UUJ5v_MCY6GNUBTO8-D3XoAg",
                "position": 7765,
                "resourceId": {
                    "kind": "youtube#video",
                    "videoId": "eJjbnFZ6yA8"
                },
                "videoOwnerChannelTitle": "WWE",
                "videoOwnerChannelId": "UCJ5v_MCY6GNUBTO8-D3XoAg"
            },
            "contentDetails": {
                "videoId": "eJjbnFZ6yA8",
                "videoPublishedAt": "2021-01-04T16:00:08Z"
            },
            "status": {
                "privacyStatus": "public"
            }
        }
    ],
    "pageInfo": {
        "totalResults": 1,
        "resultsPerPage": 50
    }
}

Initial response (17/02/2022):

That's a odd result, IMHO. You can follow any of these steps:

  • Get all playlists from a given channel and loop every video in every playlist obtained and compare to the video_id you want to check if it belongs to any playlist found.
  • If the video is not found in any playlist, probably is due the video itself does not belong to any created playlist, but, rather, to the "Uploads" playlist of the owner channel.

For check the last point I mentioned in my comment and in this answer, you can follow these steps:

  1. Replace the second character of the channel_id from "C" to "U". Example: channel_id: UCJ5v_MCY6GNUBTO8-D3XoAg - once modified, the result is: UUJ5v_MCY6GNUBTO8-D3XoAg = this is the "Upload" playlist_id of the channel UCJ5v_MCY6GNUBTO8-D3XoAg.
  2. With the upload playlist_id, paste it in this URL: https://www.youtube.com/playlist?list=<UPLOAD_PLAYLIST_ID_OF_THE_CHANNEL>

Result:

https://www.youtube.com/playlist?list=UUJ5v_MCY6GNUBTO8-D3XoAg

Then, you can yield the default "uploads" playlist of the given channel and their videos in it.


N.B that some videos (including probably the video_id you supplied) might not appear in any playlist, for example, when entering to the "upload playlist" sample (i.e. https://www.youtube.com/playlist?list=UUJ5v_MCY6GNUBTO8-D3XoAg), you might get this message above the playlist itself:

Unavailable videos are hidden.

In this case, might be worth it use the YouTube Data API to query the videos in UUJ5v_MCY6GNUBTO8-D3XoAg playlist or double-check if the video in subject in you region is available - in my case, Colombia, I got the message mentioned above, but, probably this wont happen in the US or UK.

  • Hey, you have removed your comment on my question, can you please say again - how did you get the video channel id "UUJ5v_MCY6GNUBTO8-D3XoAg" from the channel name - WWE? I mean this is the channel URL - https://www.youtube.com/c/WWE. How did you get the id "UUJ5v_MCY6GNUBTO8-D3XoAg" from here? I remember you asking me to search for it in the page source, I cannot recall how. – SexyBeast Jun 15 '22 at 08:04
  • Hello, there, @SexyBeast. I didn't remove my comments = there were cleaned up by the system :) sure: you enter to the channel - https://www.youtube.com/c/WWE - then, you can either inspect the source code of the page and type: `og:url` and you will get: `` (1/2) – Marco Aurelio Fernandez Reyes Jun 15 '22 at 13:17
  • @SexyBeast (2/2) or you can choose any video of that channel, then click on the channel icon and once done that, the URL is changed to `https://www.youtube.com/channel/UCJ5v_MCY6GNUBTO8-D3XoAg` - for some reason, this works sometimes, so, my best bet is inspect the source code of the page: press `ctrl + u` and type: `og:url`. Let me know if my comments were clear. Best of luck. – Marco Aurelio Fernandez Reyes Jun 15 '22 at 13:20
  • Yes, thanks, I remembered it eventually. :) – SexyBeast Jun 16 '22 at 16:50
  • However, when I am trying it on one channel - https://www.youtube.com/c/WTA, it is not working, I get an error - playlist not found. Can you check it please? – SexyBeast Jun 16 '22 at 19:36
  • @SexyBeast sure :) - channel_id: `` - uploads playlist_id: `UUaBIVVpHjq6j3tSyxwTE-8Q` - RSS url: `https://www.youtube.com/feeds/videos.xml?playlist_id=UUaBIVVpHjq6j3tSyxwTE-8Q` - [playlistitems youtube api endpoint - try it](https://developers.google.com/youtube/v3/docs/playlistItems/list?apix_params=%7B%22part%22%3A%5B%22id%2Csnippet%2CcontentDetails%2Cstatus%22%5D%2C%22maxResults%22%3A50%2C%22playlistId%22%3A%22UUaBIVVpHjq6j3tSyxwTE-8Q%22%7D) – Marco Aurelio Fernandez Reyes Jun 16 '22 at 19:45