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

[Request] Add Cablevision (Optimum) to --ap-mso #15121

Open
bishpuppy opened this issue Dec 30, 2017 · 4 comments · May be fixed by #15249
Open

[Request] Add Cablevision (Optimum) to --ap-mso #15121

bishpuppy opened this issue Dec 30, 2017 · 4 comments · May be fixed by #15249

Comments

@bishpuppy
Copy link

@bishpuppy bishpuppy commented Dec 30, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.12.28. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • [ x] I've verified and I assure that I'm running youtube-dl 2017.12.28

Before submitting an issue make sure you have:

  • [ x] At least skimmed through the README, most notably the FAQ and BUGS sections
  • [x ] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • [ x] Feature request (request for a new functionality)
  • [x ] Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue



I have Optimum (Cablevision in NYC) but it is currently not an option in the --ap-mso list.

Sample url: http://www.wetv.com/shows/mama-june-from-not-to-hot/full-episode/season-01/the-confrontation

Looking at the source code, 'Optimum' is labeled as 'Cablevision'. I attempted to add the following but i am not able to successfully authenticate.

-- adobepass.py --
,
'Cablevision': {
'name': 'Cablevision',
'username_field': 'IDToken1',
'password_field': 'IDToken2',
}

Looking at Optimum's login page, it looks like there is 3 hidden forms and the mso goes for the first one which is for hte username part. I added the following in an attempt to get it to login

    def post_form_cablevision(form_page_res, note, data={}):
        form_page, urlh = form_page_res
        post_url = self._html_search_regex(r'<form   name[^>]+action=(["\'])(?P<url>.+?)\1', form_page, 'post url', group='url')
		
        if not re.match(r'https?://', post_url):
            post_url = compat_urlparse.urljoin(urlh.geturl(), post_url)
        form_data = self._hidden_inputs(form_page)
        form_data.update(data)
        return self._download_webpage_handle(
            post_url, video_id, note, data=urlencode_postdata(form_data), headers={
                'Content-Type': 'application/x-www-form-urlencoded',
            })

After the if mso_id == 'Comcast_SSO': section, I added

            	elif mso_id == 'Cablevision':
            	# This will be for Cablevision login 
            	provider_redirect_page, urlh = provider_redirect_page_res
            	provider_refresh_redirect_url = extract_redirect_url( provider_redirect_page, url=urlh.geturl() )
            	if provider_refresh_redirect_url:
            		provider_redirect_page_res = self._download_webpage_handle( provider_refresh_redirect_url, video_id, 'Downloading Provider Redirect Page (meta refresh)')
            	provider_login_page_res = post_form( provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE)
            	html_code = provider_login_page_res[0].split('\n')
            	for line in html_code:
           			if 'name="goto" value="' in line:
		   				goto = line.strip().replace('<input type="hidden" name="goto" value="','').replace('">','')
		   			
           			if 'SunQueryParamsString' in line:
		   				sunquery = line.strip().replace('<input type="hidden" name="SunQueryParamsString" value="','').replace('">','')
            	mvpd_confirm_page_res = post_form_cablevision(provider_login_page_res, 'Logging in', {
                	mso_info.get('username_field', 'username'): username,
                    mso_info.get('password_field', 'password'): password,
                    'goto': goto,
                    'SunQueryParamString': sunquery,
                    'encoded': 'true',
                    'gx_charset': 'UTF-8',
                    'IDButton': '',
                })

When It tries to log in, i get a 401 - HTTP Error 401: Unauthorized -- Authentication Exception due to incorrect handler.

If i leave it with the original post_form then I get a HTTP Error 500: Internal Server Error

My apologies if I am rambling.


@bishpuppy
Copy link
Author

@bishpuppy bishpuppy commented Dec 30, 2017

How do I provide the account?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Dec 30, 2017

One who wants to work on that will post here how.

@Sparta142 Sparta142 linked a pull request that will close this issue Jan 14, 2018
4 of 9 tasks complete
@drewmorris
Copy link

@drewmorris drewmorris commented Feb 1, 2019

Was this ever merged into the main branch? I downloaded the windows exe but I can't find the Cablevision mso in the list of available mso's and it doesn't seem to work if I try to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
@drewmorris @dstftw @bishpuppy and others
You can’t perform that action at this time.