Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

videoDetails is missing author metadata #347

Open
elulcao opened this issue Nov 21, 2024 · 3 comments
Open

videoDetails is missing author metadata #347

elulcao opened this issue Nov 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@elulcao
Copy link

elulcao commented Nov 21, 2024


Describe the bug
video.vid_info.get("videoDetails") data structure is missing the "author" metadata.


code that was used that resulted in the bug

from pytubefix import YouTube as YT

        try:

            video = YT(
                "https://www.youtube.com/watch?v=4vll0yZqaM8",
                use_oauth=True,
                allow_oauth_cache=True,
                on_progress_callback=on_progress,
            )

            video_id = video.video_id
            video_title = video.title
            video_author = video.author
            video_dir = DOWNLOAD_DIR + video_author

            if video_id in get_downloaded_videos():
                print("Skipping already downloaded: ", video_id)
                time.sleep(1)
                continue

            print(video.vid_info.get("videoDetails"))

Expected behavior
The video.author property should contain the Youtube author instead of unknown


Screenshots

0 - https://www.youtube.com/watch?v=4vll0yZqaM8
{
      'videoId': '4vll0yZqaM8', 
      'lengthSeconds': '198', 
      'channelId': 'UCzfmH125g6CpiNGvgEasY1w', 
      'isOwnerViewing': False, 
      'isCrawlable': True, 
      'thumbnail': {
            'thumbnails': [
                  {
                        'url': 'https: //i.ytimg.com/vi/4vll0yZqaM8/hqdefault.jpg?v=673a028c', 
                        'width': 480, 
                        'height': 360
                  }
            ]
      }, 
      'allowRatings': True, 
      'isLowLatencyLiveStream': False, 
      'isPrivate': False, 
      'isUnpluggedCorpus': False, 
      'latencyClass': 
      'MDE_STREAM_OPTIMIZATIONS_RENDERER_LATENCY_NORMAL', 
      'isLiveContent': False
}

Desktop (please complete the following information):

  • OS: Darwin mac-mini 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:14 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8103 arm64
  • Python Version Python 3.12.7
  • Pytubefix Version pytubefix-8.5.1

Additional context
pytubefix was working fine in previous versions where the author metadata was different than unknown

@elulcao elulcao added the bug Something isn't working label Nov 21, 2024
@Concept211
Copy link

Do you happen to be running your code outside of the US? If so, I suspect it might be related to this since I'm also experiencing the same issue where the author property always returns "unknown" while running the code from a server in Germany:
#350 (comment)

@elulcao
Copy link
Author

elulcao commented Nov 25, 2024

Do you happen to be running your code outside of the US? If so, I suspect it might be related to this since I'm also experiencing the same issue where the author property always returns "unknown" while running the code from a server in Germany: #350 (comment)

Yep, running code outside US 😞 I have a VPN so I can try running within it to see if there is a difference. Not a long term solution but good to know there could be a temporary fix. BTW, previous version of pytubefix was working like a charm.

@Concept211
Copy link

Do you happen to be running your code outside of the US? If so, I suspect it might be related to this since I'm also experiencing the same issue where the author property always returns "unknown" while running the code from a server in Germany: #350 (comment)

Yep, running code outside US 😞 I have a VPN so I can try running within it to see if there is a difference. Not a long term solution but good to know there could be a temporary fix. BTW, previous version of pytubefix was working like a charm.

Thanks for confirming! I suspected that was the issue. And yes, previous versions were working for me to but I lost track which one was the last working one. The data is all there, just in a different format than expected. I had written a solution for the "date posted" property but it was never used (#138 (comment)). I think something like this will need to be implemented for each property. Would be simple enough imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants