Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Could not parse the Youtube page for URL http://youtube.com/watch?v=knN06v6UGUE #150

Closed
InVermont opened this issue Nov 10, 2015 · 29 comments

Comments

@InVermont
Copy link

Could not parse the Youtube page for URL http://youtube.com/watch?v=knN06v6UGUE
This may be due to a change of the Youtube page structure.
Please report this bug at www.github.com/flagbug/YoutubeExtractor/issues

@ghost
Copy link

ghost commented Nov 10, 2015

@flagbug @InVermont Ya same error message looks like youtube has changed something haha

Kimmax added a commit to Kimmax/SYMMExtractor that referenced this issue Nov 10, 2015
@ghost
Copy link

ghost commented Nov 10, 2015

👍 Legend

@noammaoz
Copy link

This is solve only part of the problem.
the problem start when trying to DecryptDownloadUrl and it goes to Decipherer.DecipherWithVersion and return null because the base.js is different.

Do you have a solution for this?

@noammaoz
Copy link

BTW, it require also to change the URL in Decipherer.DecipherWithVersion from:
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/html5player-{0}.js", cipherVersion);
to
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/player-{0}.js", cipherVersion);

@Kimmax
Copy link
Contributor

Kimmax commented Nov 10, 2015

Apperently my cursor is good at selecting videos that don't need decryption.
I will look into this when I'm back home. As long as we can read the js file we should be able to fix this.

Kimmax added a commit to Kimmax/SYMMExtractor that referenced this issue Nov 10, 2015
@Kimmax
Copy link
Contributor

Kimmax commented Nov 10, 2015

Looks like YouTube changed the ciphering more than last time, we'll have to find the code to reverse it in the player js code 👎
Example for non working link: https://www.youtube.com/watch?v=QcIy9NiNbmo

@noammaoz
Copy link

I have made the following changes and it work for me now:
Class DownloadUrlResolver -> GetHtml5PlayerVersion change from
var regex = new Regex(@"html5player-(.+?).js");
to
var regex = new Regex(@"player-(.+?).js");

Class Decipherer -> DecipherWithVersion several changes as follows:
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/html5player-{0}.js", cipherVersion);
to
string jsUrl = string.Format("http://s.ytimg.com/yts/jsbin/player-{0}.js", cipherVersion);

string funcBodyPattern = @"(?{([^{}]| ?(brace))})";
to
//string funcBodyPattern = @"(?{([^{}]| ?(brace))
})";

string funcPattern = string.Format(@"{0}(\w+){1}", @funcName, funcBodyPattern);
to
string funcPattern = @"var " + @funcName + @"=function(\w+){.*?};";

var funcBody = Regex.Match(js, funcPattern).Groups["brace"].Value;
to
var funcBody = Regex.Match(js, funcPattern).Value;

for now. this is working well for me on all YouTube video that I have tried.

@GrabzIt
Copy link

GrabzIt commented Nov 10, 2015

I think it should be:

string funcPattern = @"var " + @funcName + @"=function(\w+){.*?};";

Although after looking at my own comment I think it is Github messing up your formatting.

@ghost
Copy link

ghost commented Nov 10, 2015

I don't include the source for YouTube Extractor in my solution. Can the developer please update the nuget package to get around this problem? Thanks.

@MarkOvery
Copy link

+1 on a request for an update to the nuget package.

@ghost
Copy link

ghost commented Nov 11, 2015

@InVermont, @noammaoz, @GrabzIt and @reincurred-biddle https://github.com/Kimmax/YoutubeExtractor is working great just DecryptDownloadUrl is not working i dont think @flagbug is going to update the nuget anytime soon

@noammaoz
Copy link

@Kimmax YoutubeExtractor is the most updated version?

@Kimmax
Copy link
Contributor

Kimmax commented Nov 11, 2015

To clarify:
I might be working the most on the extractor, but it isn't extractor only anymore.
I added ffmpeg for the audio extraction (faster, almost all codecs supported) and an audio streamer.
I will implement the fixes from above (Thanks btw) and than my fork should work well.

@AnonymousUser200102010
Copy link

Does someone have a working version? I'd like to not change my backend yet if at all possible.

No channels work at all for me now.

@waxerjo
Copy link

waxerjo commented Nov 11, 2015

I'm waiting nuget update.

Kimmax added a commit to Kimmax/SYMMExtractor that referenced this issue Nov 11, 2015
@Kimmax
Copy link
Contributor

Kimmax commented Nov 11, 2015

i think I got it running again with the code @noammaoz provied, ty!
Although I needed to escape the braces in the regex

string funcPattern = @"var " + @funcName + @"=function\(\w+\)\{.*?\};";

Can someone confirm this working again?
Tested with http://youtube.com/watch?v=knN06v6UGUE and https://www.youtube.com/watch?v=QcIy9NiNbmo
I obviously can't update the nuget. I will wait a week if nothing happens from @flagbug 's side by than I'm will create my own.
(Sorry for my bad russian)

@ghost
Copy link

ghost commented Nov 11, 2015

@Kimmax Works great with https://github.com/di48l069/Flash-dl 👍 Create a pull request so @flagbug can update it. 👍

@Kimmax
Copy link
Contributor

Kimmax commented Nov 11, 2015

I cant open a pull request for one commit only and my fork has abbreviated too much

@ghost
Copy link

ghost commented Nov 11, 2015

True story

@screamingworld
Copy link

@Kimmax thank you for your fork!

ovnisoftware added a commit to ovnisoftware/YoutubeExtractor that referenced this issue Nov 13, 2015
@ovnisoftware
Copy link
Contributor

I opened a pull request with Kimmax's fix for this issue. It has worked for all the links I have tested it with.

@dragthor
Copy link

@ovnisoftware changes seems to have resolved the issue - #151

@nimobeeren
Copy link

Not familiar with the way these bugfixes are handled with regard to releases, but will we see a NuGet update in the near future?

@Kimmax
Copy link
Contributor

Kimmax commented Nov 13, 2015

Pull request is open, maybe @flagbug just has not enough time. I dropped him a mail asking for push rights here, so I could handle fixes like this in the future. This also includes the nuget.

@flagbug
Copy link
Owner

flagbug commented Nov 13, 2015

Hi ya'll, while I don't actively work on this project anymore, I'm still here.

The reason I didn't accept most of the pull requests is, because they either completely changed the formatting of the source code or added something (in my opinion) completely unnecessary.

I'll review the PR with the parser fix within the next two days and merge it. I'll probably also make some changes to YoutubeExtractor:

I'm probably going to completely remove the logic for video and audio extraction. The only format YoutubeExtractor can currently extract is Flash, which is a format that's basically dead. As an alternative, you can use FFMPEG, which can do wayyy more then just extracting Flash videos.

The video extraction code is written with old .NET 3.5 style, but with .NET 4.5, we're living in an async/await world. I also think that the download of the video should be the responsibility of the user of this library, not the library itself.

@ovnisoftware
Copy link
Contributor

In the meantime, here's a temporary fix. Replace the existing YoutubeExtractor.dll reference in your project with the .dll in this repo.

https://github.com/ovnisoftware/YoutubeExtractor-Fix

@nimobeeren
Copy link

@ovnisoftware Thank you! I will use your fork with much gratitude while I await a NuGet update.

flagbug added a commit that referenced this issue Nov 17, 2015
@flagbug
Copy link
Owner

flagbug commented Nov 17, 2015

I've published a new release to NuGet, thanks @Kimmax and all the others!

@kumkumbum001
Copy link

Tôi đã xuất bản một bản phát hành mới cho NuGet, cảm ơn @Kimmax và tất cả những người khác!

Can you send me the updated NuGet?
My Email: fungzhangteemo@gmail.com

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests