https://www.youtube.com/get_video_info?video_id= {videoid} lance
Le code d'état de réponse n'indique pas le succès: 404 (non trouvé).
Essayez 1060 Correction - Ce numéro est encore à être corrigé dans le package Pytube. Jusqu'à ce qu'il soit officiellement disponible dans Pytube, vous pouvez installer ci-dessous un dans votre système pour obtenir le téléchargement de travail. https://github.com/zeecka/pytube/tree/fix_106
Pour plus de détails, vous pouvez vous référer https://github.com/pytube/pytube/pytube/issues/106
La meilleure solution que j'ai trouvée jusqu'à présent pour Python projets qui nécessitent les données de la get_video_info
API semble être d'utiliser l'API InnerTube
à partir du projet pytube
projet :
>>> from pytube.innertube import InnerTube
>>> innertube = InnerTube()
>>> video_info = innertube.player("dQw4w9WgXcQ")
>>> video_info.keys()
dict_keys(['responseContext', 'trackingParams', 'adBreakParams', 'playabilityStatus', 'streamingData', 'playbackTracking', 'videoDetails', 'annotations', 'playerConfig', 'storyboards', 'attestation', 'videoQualityPromoSupportedRenderers', 'messages', 'endscreen', 'playerSettingsMenuData'])
>>> video_info["videoDetails"]
{'videoId': 'dQw4w9WgXcQ', 'title': 'Rick Astley - Never Gonna Give You Up (Official Music Video)', 'lengthSeconds': '212', 'keywords': ['rick astley', 'Never Gonna Give You Up', 'nggyu', 'never gonna give you up lyrics', 'rick rolled', 'the boys soundtrack', 'the boys Amazon prime', 'Never gonna give you up the boys', 'official', 'Rick Roll', 'music video', 'Rick Astley album', 'rick astley official', 'together forever', 'Whenever You Need Somebody', 'rickrolled', 'WRECK-IT RALPH 2', 'Fortnite song', 'Fortnite event', 'Fortnite dance', 'fortnite never gonna give you up', 'rick astley never gonna give you up', 'rick astley never gonna give you up lyrics'], 'channelId': 'UCuAXFkgsw1L7xaCfnd5JJOw', 'isOwnerViewing': False, 'shortDescription': "Rick Astley's official music video for “Never Gonna Give You Up” \n\nSubscribe to the official Rick Astley YouTube channel: https://RickAstley.lnk.to/YTSubID\n\nFollow Rick Astley:\nFacebook: https://RickAstley.lnk.to/FBFollowID \nTwitter: https://RickAstley.lnk.to/TwitterID \nInstagram: https://RickAstley.lnk.to/InstagramID \nWebsite: https://RickAstley.lnk.to/storeID \nTikTok: https://RickAstley.lnk.to/TikTokID\n\nListen to Rick Astley:\nSpotify: https://RickAstley.lnk.to/SpotifyID \nApple Music: https://RickAstley.lnk.to/AppleMusicID \nAmazon Music: https://RickAstley.lnk.to/AmazonMusicID \nDeezer: https://RickAstley.lnk.to/DeezerID \n\nLyrics:\nWe’re no strangers to love\nYou know the rules and so do I\nA full commitment’s what I’m thinking of\nYou wouldn’t get this from any other guy\n\nI just wanna tell you how I’m feeling\nGotta make you understand\n\nNever gonna give you up\nNever gonna let you down\nNever gonna run around and desert you\nNever gonna make you cry\nNever gonna say goodbye\nNever gonna tell a lie and hurt you\n\nWe’ve known each other for so long\nYour heart’s been aching but you’re too shy to say it\nInside we both know what’s been going on\nWe know the game and we’re gonna play it\n\nAnd if you ask me how I’m feeling\nDon’t tell me you’re too blind to see\n\nNever gonna give you up\nNever gonna let you down\nNever gonna run around and desert you\nNever gonna make you cry\nNever gonna say goodbye\nNever gonna tell a lie and hurt you\n\n#RickAstley #NeverGonnaGiveYouUp #OfficialMusicVideo", 'isCrawlable': True, 'thumbnail': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg', 'width': 120, 'height': 90}, {'url': 'https://i.ytimg.com/vi/dQw4w9WgXcQ/mqdefault.jpg', 'width': 320, 'height': 180}, {'url': 'https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg', 'width': 480, 'height': 360}, {'url': 'https://i.ytimg.com/vi/dQw4w9WgXcQ/sddefault.jpg', 'width': 640, 'height': 480}]}, 'averageRating': 4.893901, 'allowRatings': True, 'viewCount': '1031179782', 'author': 'Rick Astley', 'isPrivate': False, 'isUnpluggedCorpus': False, 'isLiveContent': False}