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

Unable to stream age gated video '6kLq3WMV1nU' #431

Closed
1-geo opened this issue Apr 20, 2019 · 3 comments
Closed

Unable to stream age gated video '6kLq3WMV1nU' #431

1-geo opened this issue Apr 20, 2019 · 3 comments

Comments

@1-geo
Copy link

1-geo commented Apr 20, 2019

I am trying a age restricted video but it seems it is not able to get any urls and failing. I believe embed is not allowed here. I have attached the link below from youtube-dl where it seems to be working.

https://github.com/ytdl-org/youtube-dl/blob/98998cded6e179b35055177f75fc921d99ee5938/youtube_dl/extractor/youtube.py#L440

Getting error below

[XCDYouTubeKit] Video operation finished with error: Sign in to confirm your age
Domain: XCDYouTubeVideoErrorDomain
Code:   150
User Info: {
    NSLocalizedDescription = "Sign in to confirm your age";
    NSURL = "https://www.youtube.com/get_video_info?el=detailpage&hl=en&ps=default&video_id=6kLq3WMV1nU";
}
@SoneeJohn
Copy link
Collaborator

SoneeJohn commented Apr 24, 2019

Were you able to get that working with the latest version of youtube-dl? You might have to use the cookie feature in XCDYouTubeKit to get that working. See

/**
* Starts an asynchronous operation for the specified video identifier, and calls a handler upon completion.
*
* @param videoIdentifier A 11 characters YouTube video identifier. If the video identifier is invalid (including nil) the completion handler will be called with an error with `XCDYouTubeVideoErrorDomain` domain and `XCDYouTubeErrorInvalidVideoIdentifier` code.
* @param cookies An array of `NSHTTPCookie` objects, can be nil. These cookies can be used for certain videos that require a login.
* @param completionHandler A block to execute when the client finishes the operation. The completion handler is executed on the main thread. If the completion handler is nil, this method throws an exception.
*
* @discussion If the operation completes successfully, the video parameter of the handler block contains a `<XCDYouTubeVideo>` object, and the error parameter is nil. If the operation fails, the video parameter is nil and the error parameter contains information about the failure. The error's domain is always `XCDYouTubeVideoErrorDomain`.
*
* @see XCDYouTubeErrorCode
*
* @return An opaque object conforming to the `<XCDYouTubeOperation>` protocol for canceling the asynchronous video information operation. If you call the `cancel` method before the operation is finished, the completion handler will not be called. It is recommended that you store this opaque object as a weak property.
*/
- (id<XCDYouTubeOperation>) getVideoWithIdentifier:(NSString *)videoIdentifier cookies:(nullable NSArray <NSHTTPCookie *>*)cookies completionHandler:(void (^)(XCDYouTubeVideo * __nullable video, NSError * __nullable error))completionHandler;

@1-geo
Copy link
Author

1-geo commented Apr 30, 2019

Hi @SoneeJohn Yeah probably thats why. But how does youtube-dl work without any log in? Pretty weird unless its using some defaults. Any examples on how to use the cookie feature. Thanks

@SoneeJohn
Copy link
Collaborator

Working on a fix so you can do this without needing cookies.

SoneeJohn added a commit that referenced this issue May 6, 2019
SoneeJohn added a commit that referenced this issue May 7, 2019
* Add the ability to fetch certain age-gate videos. (#431)
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
Hesowcharov pushed a commit to Hesowcharov/XCDYouTubeKit that referenced this issue Sep 27, 2023
* Add the ability to fetch certain age-gate videos. (0xced#431)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants