ybd-project / ytdl-core

Fast and secure YouTube downloader for JavaScript and TypeScript
MIT License
27 stars 5 forks source link

im having an issue in getBasicInfo #11

Closed c-o-d-e-xx closed 2 months ago

c-o-d-e-xx commented 2 months ago

Describe the bug

while using getBasic info tile is not in the response Title of the related videos are there but I need the title of the video i requested

Error Details (Log)

{ _watchPageInfo: { page: 'watch', player_response: { responseContext: [Object], playabilityStatus: [Object], trackingParams: 'CAAQu2kiEwjRnMen3bCIAxUeYEwIHWU9Jfw=', messages: [Array], adBreakHeartbeatParams: 'Q0FBJTNE', frameworkUpdates: [Object] }, response: { Error downloading video: Cannot read properties of undefined (reading 'replace') responseContext: [Object], contents: [Object], currentVideoEndpoint: [Object], trackingParams: 'CAAQg2ciEwj2pMen3bCIAxWT1ZcIHdGdAgo=', playerOverlays: [Object], onResponseReceivedEndpoints: [Array], engagementPanels: [Array], topbar: [Object], pageVisualEffects: [Array], frameworkUpdates: [Object] }, html5Player: 'https://www.youtube.com/s/player/5f8f5b0f/player_ias.vflset/en_US/base.js' }, related_videos: [ { id: 'U2B6yWfx_tU', title: 'അരുൺ കള്ള പരാതി പൊളിച്ചു കയ്യിൽ കൊടുത്തു | Malayalamtroll', published: '2 days ago', author: [Object], short_view_count_text: '525K', view_count: '525142', length_seconds: 485, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: '2zYWZCcQz-c', title: "'നിവിന്‍ പോളി എന്നെ ലൈംഗികമായി പീഡിപ്പിച്ചു, പരാതിയില്‍ ഉറച്ച് നില്‍ക്കുന്നു' | Nivin Pauly", published: '3 days ago', author: [Object], short_view_count_text: '282K', view_count: '282679', length_seconds: 2136, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: '90YUS2HMack', title: 'ലാലേട്ടന്റെ കുട്ടികളെ പ്രസവിക്കാൻ ഗർഭം ധരിച്ച നടികൾ ? Mohanlal Stories', published: '7 hours ago', author: [Object], short_view_count_text: '117K', view_count: '117616', length_seconds: 872, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'vlU9P-ia23I', title: "'ആരോപണങ്ങൾ വ്യാജം, കൂടെ ആരും ഇല്ലെങ്കിലും ഒറ്റയ്ക്ക് പോരാടും' | Nivin Pauly Press Meet | Full Video", published: '3 days ago', author: [Object], short_view_count_text: '764K', view_count: '764132', length_seconds: 1061, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 's5b0bff7nIY', title: 'ബംഗ്ലാദേശ് ഇല്ലാതാകും! | ABC MALAYALAM NEWS |', published: '5 hours ago', author: [Object], short_view_count_text: '34K', view_count: '34731', length_seconds: 605, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'RClk3w9T6ec', title: 'Nivin Poly നിവിൻ എന്ന രക്ഷകൻ സിനമലോകം ശ്വാസം വിട്ടു.', published: '4 hours ago', author: [Object], short_view_count_text: '21K', view_count: '21720', length_seconds: 379, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'P6FRHSZXlNQ', title: 'പരസ്പരം Thug ഡയലോഗ് അടിച്ച് Tovino & Santhosh George Kulangara | Exclusive Meetup | ARM | Part 02', published: '21 hours ago', author: [Object], short_view_count_text: '131K', view_count: '131262', length_seconds: 1511, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'wvuQ5fQhIe4', title: 'ഞാൻ വേണേൽ പരാതി പിൻവലിക്കാം Nivin Pauly Latest News | Hema Commission | Mallu Yankee', published: '1 day ago', author: [Object], short_view_count_text: '196K', view_count: '196259', length_seconds: 147, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'uy3zMe0osJU', title: 'ചേച്ചി ആകെ പെട്ടു ഗയ്സ് 🤣 Nivin Pauly Latest News | Nivin Pauly |Sajini Thomas | Vyshnav Trolls', published: '1 day ago', author: [Object], short_view_count_text: '399K', view_count: '399401', length_seconds: 138, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'OolSah8Gegc', title: 'വായിൽ തോന്നിയ പറയുമ്പോൾ ആലോചിക്കണം 🙏 nivin pauly said about| sajini Thomas', published: '16 hours ago', author: [Object], short_view_count_text: '288K', view_count: '288732', length_seconds: 122, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: '-klI0CpMdnA', title: 'നിവിൻ പോളിയുടെ കഥ, സജിനി തോമസിന്റെയും | ജയിൽ ഇടിഞ്ഞാലും രക്ഷപെടില്ല | Nivin Pauly booked |', published: '2 days ago', author: [Object], short_view_count_text: '133K', view_count: '133494', length_seconds: 636, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: '7-ZoXeeh4SY', title: 'അറിയാതെ സത്യം വിളിച്ചു പറഞ്ഞു Rima Kallingal Latest | Ashiq Abu | Hema Commission | Mallu Yankee', published: '1 hour ago', author: [Object], short_view_count_text: '1.7K', view_count: '1707', length_seconds: 166, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: '7_PT5jxwoPk', title: 'മട്ടാഞ്ചേരി മാഫിയയുടെ ഡീലുകൾ ചുരുളഴിയുന്നു!| MEDIA MALAYALAM', published: '2 days ago', author: [Object], short_view_count_text: '63K', view_count: '63490', length_seconds: 650, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'uiV0ksryg1k', title: 'റിപ്പോർട്ടർ പീഡന കേസ്: ഇതാ ആ ഞെട്ടിക്കുന്ന ശബ്ദരേഖ I About Reporter tv fake news', published: '1 day ago', author: [Object], short_view_count_text: '178K', view_count: '178788', length_seconds: 585, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'yVG-cSklh6U', title: 'ഇവൻ ആള് കൊള്ളാം, ടീച്ചർ ആദ്യമൊന്ന് പകച്ചു| Funny Moments|90sKID|Factsmojo|Comedy|Malayalam', published: '13 days ago', author: [Object], short_view_count_text: '164K', view_count: '164451', length_seconds: 605, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'EYFiXYZQL8I', title: '|CHEF INTERVIEW|ഹോട്ടൽ ഇന്റർവ്യൂ |Malayalam Comedy Video|Sanju&Lakshmy|Enthuvayith|', published: '2 hours ago', author: [Object], short_view_count_text: '37K', view_count: '37842', length_seconds: 884, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'lfN3e9oflDs', title: 'ചേച്ചിയുടെ ഉടായിപ്പ് പൊളിച്ചു കൊടുത്തു', published: '2 days ago', author: [Object], short_view_count_text: '144K', view_count: '144233', length_seconds: 147, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'oNk4CM-0kBg', title: 'റിപ്പോർട്ടർന് വയറുനറച്ചു കിട്ടി 😂| Amma Industry issue Troll Video | Akhil Marar | Troll Video', published: '4 days ago', author: [Object], short_view_count_text: '142K', view_count: '142022', length_seconds: 269, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: 'XMPgbFXdyVA', title: 'റിമയെ കുരുക്കി വിവാദം; Bhagyalakshmi Against Aashiq Abu and Rima', published: '3 days ago', author: [Object], short_view_count_text: '657K', view_count: '657967', length_seconds: 895, thumbnails: [Array], richThumbnails: [Array], isLive: false } ], videoDetails: { video_url: 'https://www.youtube.com/watch?v=X3s3yowf3e8', author: null, media: null, likes: 7521, age_restricted: false, storyboards: [], chapters: [] }, formats: [], html5Player: 'https://www.youtube.com/s/player/5f8f5b0f/player_ias.vflset/en_US/base.js', clients: [ 'web_creator', 'tv_embedded', 'ios', 'android' ], full: false, isMinimumMode: false, _ytdl: { version: '5.0.18' }

Environment

Hosting in render

ybd-project commented 2 months ago

Thank you for your report. Can you tell me what code you are implementing if possible? I will try to test it here as well.

c-o-d-e-xx commented 2 months ago

Sir this is my code https://pastecode.io/s/2jso5m75

c-o-d-e-xx commented 2 months ago

Also the details of related videos are perfect details of video i request is mostly null

ybd-project commented 2 months ago

Sir this is my code https://pastecode.io/s/2jso5m75

Thank you, your code seems fine, I'll check it here.

c-o-d-e-xx commented 2 months ago

Thanks for the quick response ☺️

ybd-project commented 2 months ago

Thanks for the quick response ☺️

I have one more request. Can you please tell me what logs are output with YTDL_DEBUG=true in the environment variable?

c-o-d-e-xx commented 2 months ago

I didn't get you bro what you mean should I add env variable YTDL_DEBUG=true

ybd-project commented 2 months ago

I didn't get you bro what you mean should I add env variable YTDL_DEBUG=true

Yes. That is what I mean. I'm sorry it was not clear.

c-o-d-e-xx commented 2 months ago

How should I add env to my render app or inside the code

c-o-d-e-xx commented 2 months ago

Screenshot_20240907-174508 Is this enough

ybd-project commented 2 months ago

You can add it by opening the application you are deploying and selecting "Add environment variable" from the "Environment" menu.

ybd-project commented 2 months ago

Screenshot_20240907-174508 Is this enough

yes. It's ok

c-o-d-e-xx commented 2 months ago

Now this is error [ DEBUG ]: [ web_creator ]: Error Reason: Sign in to confirm you’re not a bot

Reason: Sign in to confirm you’re not a bot

Reason: Sign in to confirm you’re not a bot

Reason: Sign in to confirm you’re not a bot { _watchPageInfo: { page: 'watch', player_response: { responseContext: [Object], playabilityStatus: [Object], trackingParams: 'CAAQu2kiEwi4ioWU6bCIAxXla0wIHbLtMCw=', messages: [Array], adBreakHeartbeatParams: 'Q0FBJTNE', frameworkUpdates: [Object] }, response: { responseContext: [Object], contents: [Object], currentVideoEndpoint: [Object], trackingParams: 'CAAQg2ciEwiZnIWU6bCIAxXP2JcIHTDREvY=', playerOverlays: [Object], onResponseReceivedEndpoints: [Array], engagementPanels: [Array], Error downloading video: Cannot read properties of undefined (reading 'replace') topbar: [Object], pageVisualEffects: [Array], frameworkUpdates: [Object] }, html5Player: 'https://www.youtube.com/s/player/5f8f5b0f/player_ias.vflset/en_US/base.js' }, related_videos: [ { id: 'gJLVTKhTnog', title: 'Anuv Jain - HUSN (Official Video)', published: '9 months ago', author: [Object], short_view_count_text: '125M', view_count: '125303868', length_seconds: 240, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'BVa70AB1SR0', title: 'JO TUM MERE HO - Anuv Jain | Cover Song', published: '3 weeks ago', author: [Object], short_view_count_text: '547', view_count: '547', length_seconds: 211, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'IJeSR-LJBnk', title: 'ISHQ - Music Film I Amir Ameer I Faheem Abdullah I Rauhan Malik I Samreen Kaur I Mir Tafazul', published: '4 months ago', author: [Object], short_view_count_text: '27M', view_count: '27068109', length_seconds: 470, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: '-2RAq5o5pwc', title: 'Jhol | Coke Studio Pakistan | Season 15 | Maanu x Annural Khalid', published: '2 months ago', author: [Object], short_view_count_text: '14M', view_count: '14831773', length_seconds: 279, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'hHuG7FIKgtc', title: 'Ishq Official Lyrical Video I @TheAmer311 I@theimaginarypoet I@rauhanmalik I Love Song 2024', published: '5 months ago', author: [Object], short_view_count_text: '37M', view_count: '37751940', length_seconds: 229, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'gkCKTuR-ECI', title: 'Rockstar: Tum Ho Lyrical Video Song | Ranbir Kapoor | Nargis Fakhri | T-Series', published: '6 years ago', author: [Object], short_view_count_text: '105M', view_count: '105710511', length_seconds: 322, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: '72eQoVgbEG8', title: 'Unforgettable Choo Lo Mashup 2.0 - Shivendra Singh & Anuv Jain', published: '5 months ago', author: [Object], short_view_count_text: '2.9M', view_count: '2926910', length_seconds: 1338, thumbnails: [Array], richThumbnails: [Array], isLive: false }, { id: '4DVDFxiZKCg', title: 'O Yaara | Coke Studio Pakistan | Season 15 | Abdul Hannan x Kaavish', published: '3 months ago', author: [Object], short_view_count_text: '15M', view_count: '15051533', length_seconds: 291, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'b55fIOZaSh4', title: 'CHAL DIYE TUM KAHAN | AUDIO 🎧 | AUR | AHAD KHAN & USAMA ALI | RAFFEY ANWAR | KABHI MAIN KABHI TUM', published: '1 month ago', author: [Object], short_view_count_text: '5.1M', view_count: '5162363', length_seconds: 276, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'SmaY7RfBgas', title: 'Anuv Jain - GUL (Studio)', published: '3 years ago', author: [Object], short_view_count_text: '55M', view_count: '55227515', length_seconds: 225, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'EVF_AuhJgLg', title: 'Non-Stop Road Trip Jukebox (Extended) | SICKVED | Best Travelling Songs | Bollywood', published: '1 year ago', author: [Object], short_view_count_text: '16M', view_count: '16458132', length_seconds: 2514, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'T94PHkuydcw', title: 'Kun Faya Kun Full Video Song Rockstar | Ranbir Kapoor | A.R. Rahman, Javed Ali, Mohit Chauhan', published: '12 years ago', author: [Object], short_view_count_text: '410M', view_count: '410246820', length_seconds: 381, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'AKH6ZNSnWOA', title: 'SUNIYAN SUNIYAN (Official Video) Juss x MixSingh', published: '4 months ago', author: [Object], short_view_count_text: '113M', view_count: '113934198', length_seconds: 211, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: '_mR6bY-ndso', title: 'Husn Mashup (Extended) | Anuv Jain | Let Her Go X Husn X Choo Lo X Jiyein Kyun | Sid Guldekar', published: '6 months ago', author: [Object], short_view_count_text: '8.8M', view_count: '8839375', length_seconds: 647, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'Gz38Yj09k3A', title: 'Hasan Raheem - Wishes ft Talwiinder | Prod by Umair (Official Lyric Video)', published: '1 year ago', author: [Object], short_view_count_text: '30M', view_count: '30351142', length_seconds: 219, thumbnails: [Array], richThumbnails: [], isLive: false }, { id: 'NDjeeJwI08Q', title: 'Haan Ke Haan Song | Maharaj | A Netflix Film | Junaid, Sharvari, Sohail Sen, Monali Thakur, Kausar M', published: '2 months ago', author: [Object], short_view_count_text: '25M', view_count: '25259936', length_seconds: 191, thumbnails: [Array], richThumbnails: [], isLive: false } ], videoDetails: { video_url: 'https://www.youtube.com/watch?v=ilNt2bikxDI', author: null, media: null, likes: 257005, age_restricted: false, storyboards: [], chapters: [] }, formats: [], html5Player: 'https://www.youtube.com/s/player/5f8f5b0f/player_ias.vflset/en_US/base.js', clients: [ 'web_creator', 'tv_embedded', 'ios', 'android' ], full: false, isMinimumMode: false, _ytdl: { version: '5.0.19' } } TypeError: Cannot read properties of undefined (reading 'replace') at ytv (/lib/ytdl.js:17:39) at processTicksAndRejections (node:internal/process/task_queues:95:5) at /routes/download.js:47:22

ybd-project commented 2 months ago

Thank you very much. It is a bot error, please generate the poToken again or try OAuth2.

c-o-d-e-xx commented 2 months ago

I think the bot error came while downloading the video

c-o-d-e-xx commented 2 months ago

If there is a bot error how should it print this much data also related videos are okay but the video title and other detail are not available

ybd-project commented 2 months ago

If a bot error occurs, we use the information that can be retrieved from the Watch page (youtube.com/watch?v=) and the information that can be retrieved even in the event of an error.

c-o-d-e-xx commented 2 months ago

Should I use po token while creating stream const videoStream = ytdl(videoUrl, { filter: 'audioandvideo' });

ybd-project commented 2 months ago

Should I use po token while creating stream const videoStream = ytdl(videoUrl, { filter: 'audioandvideo' });

Yes. It is better than not doing it.

c-o-d-e-xx commented 2 months ago

filter: audioandvideo is that valid

ybd-project commented 2 months ago

filter: audioandvideo is that valid

yes

ybd-project commented 2 months ago

Glitch's test server can successfully retrieve information using OAuth2.

c-o-d-e-xx commented 2 months ago

Bro now also the same error bot error why bro I have added potoken as you said

c-o-d-e-xx commented 2 months ago

Bro should I create a new potoken

ybd-project commented 2 months ago

Bro should I create a new potoken

Yes. Or try using OAuth2

c-o-d-e-xx commented 2 months ago

As a single solution using proxy agent will solve the problem or not

ybd-project commented 2 months ago

As a single solution using proxy agent will solve the problem or not

Proxies may temporarily solve the problem, but they are unstable and deprecated.

ybd-project commented 2 months ago

Is the problem resolved? If no progress is made, close as not necessary to correct.

c-o-d-e-xx commented 2 months ago

Bro I didn't test after that due to health issues I'll look up to this today and update you

ybd-project commented 2 months ago

Bro I didn't test after that due to health issues I'll look up to this today and update you

Thank you. We look forward to receiving your test results.

c-o-d-e-xx commented 2 months ago

Sir now I just tried creating new po token same login issue so what I need to do next auth 2 which method should I use normal or specify client data

ybd-project commented 2 months ago

Sir now I just tried creating new po token same login issue so what I need to do next auth 2 which method should I use normal or specify client data

We recommend the usual method.

c-o-d-e-xx commented 2 months ago

Ok thanks☺️

c-o-d-e-xx commented 2 months ago

Bro were I can get client id and secret also which method should I use to generate my own using the method in example folder or not

ybd-project commented 2 months ago

Please see this. https://support.google.com/cloud/answer/6158849?hl=en

c-o-d-e-xx commented 2 months ago

Screenshot_20240909-141159 Here which method should I use

ybd-project commented 2 months ago

External

c-o-d-e-xx commented 2 months ago

Screenshot_20240910-195458 This is what shows when I try to make auth2

ybd-project commented 2 months ago

What code are you implementing? If 401, your OAuth client may not be well configured.

c-o-d-e-xx commented 2 months ago

Im trying to make auth2 token

c-o-d-e-xx commented 2 months ago

This is the repo made using ur example file to generate auth2 https://github.com/c-o-d-e-xx/auth2

ybd-project commented 2 months ago

Is the type of OAuth2 client you created “TV and devices with limited input capabilities”?

c-o-d-e-xx commented 2 months ago

I don't know that exactly

ybd-project commented 2 months ago

image Is the “Type” of this set to “TV and Limited Input”?

c-o-d-e-xx commented 2 months ago

No

c-o-d-e-xx commented 2 months ago

Screenshot_20240912-180949 How to change this

ybd-project commented 2 months ago

Now change the type to the appropriate one and generate it again.

c-o-d-e-xx commented 2 months ago

Screenshot_20240913-152521 Now I have this error

ybd-project commented 2 months ago

Did you open "https://www.google.com/device" and follow the instructions to the end?

c-o-d-e-xx commented 2 months ago

Screenshot_20240913-205907 Now I get this error