• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript I need a help to get a list of videos url, title, views & upload date in youtube channel

ananthrajan95

New Coder
I need a help to get a list of videos url, title, views & upload date in youtube channel

Already I have few codes to get a list videos url & title. But I also need views & upload date. Can anyone please help me in this.

Details:
1. Open YouTube channel
2. Click of Video Tab
3. Right-click on the page
4. Click on Inspect
5. Click on Console
6. Copy and Paste this Code and Press Enter
var scroll = setInterval(function(){ window.scrollBy(0, 1000)}, 1000);

7. Wait till loading all videos
8. Copy and Paste this Code and Press Enter
window.clearInterval(scroll); console.clear(); urls = $$('a'); urls.forEach(function(v,i,a){if (v.id=="video-title"){console.log('\t'+v.title+'\t'+v.href+'\t')}});

9. Click any URL and Press Ctrl+A
10. Open Microsoft Excel or Word and Press Ctrl+v

Can anyone help me to get views + Upload date too in this format. Thanks in Advance
 

OldMan

King Coder
You don't give any clue into how you're doing things. I would make the site a string and then search for keywords and then extract the info I needed. First word to search for is ytd-video-view-count-renderer and the second is ytd-video-primary-info-renderer. See the code below:
Code:
<ytd-badge-supported-renderer class="style-scope ytd-video-primary-info-renderer" disable-upgrade="" hidden ytd-badge-supported-renderer>
    <div id="info" class="style-scope ytd-video-primary-info-renderer">
      <div id="info-text" class="style-scope ytd-video-primary-info-renderer">
        
        <div id="count" class="style-scope ytd-video-primary-info-renderer">
          <ytd-video-view-count-renderer class="style-scope ytd-video-primary-info-renderer" small="">
            
            <!--css-build:shady-->
            <span class="view-count style-scope ytd-video-view-count-renderer">39,214 views</span>
            <span class="short-view-count style-scope ytd-video-view-count-renderer">39K views</span>
          </ytd-video-view-count-renderer>
        </div>

        <div id="info-strings" class="style-scope ytd-video-primary-info-renderer">

          <span id="dot" class="style-scope ytd-video-primary-info-renderer"></span>

        <yt-formatted-string class="style-scope ytd-video-primary-info-renderer">Nov 20, 2021</yt-formatted-string>
 

joshuek

New Coder
I’m sure there should be an API that would be able to do that? have you tried DOM?
You can also try Google Takeout. It allows you to export your data from Google, including downloading all your YouTube videos and their metadata. Check out this guide
. The author explains how to do that step by step.
And if you just need to download the video, without their metadata files, you can simply use this youtube downloade site. You need to insert the link to the necessary video, choose the quality you need, and download it.
 

Antero360

King Coder
Staff Team
Security Analyst
I need a help to get a list of videos url, title, views & upload date in youtube channel

Already I have few codes to get a list videos url & title. But I also need views & upload date. Can anyone please help me in this.

Details:
1. Open YouTube channel
2. Click of Video Tab
3. Right-click on the page
4. Click on Inspect
5. Click on Console
6. Copy and Paste this Code and Press Enter
var scroll = setInterval(function(){ window.scrollBy(0, 1000)}, 1000);

7. Wait till loading all videos
8. Copy and Paste this Code and Press Enter
window.clearInterval(scroll); console.clear(); urls = $$('a'); urls.forEach(function(v,i,a){if (v.id=="video-title"){console.log('\t'+v.title+'\t'+v.href+'\t')}});

9. Click any URL and Press Ctrl+A
10. Open Microsoft Excel or Word and Press Ctrl+v

Can anyone help me to get views + Upload date too in this format. Thanks in Advance
What is the intended purpose for this functionality?
 
Top