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

AttributeError: 'NoneType' object has no attribute 'span' #5

Open
codenamewei opened this issue Feb 5, 2022 · 2 comments
Open

AttributeError: 'NoneType' object has no attribute 'span' #5

codenamewei opened this issue Feb 5, 2022 · 2 comments
Labels
bug Something isn't working workaround

Comments

@codenamewei
Copy link
Owner

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
C:\Users\CODENA~1\AppData\Local\Temp/ipykernel_26760/3533367376.py in <module>
     12 
     13         #converter.url2audio(urlpath = row.url, audiofile = title + ".flac", audiosamplingrate=16000)
---> 14         converter.url2text(urlpath = row.url, outfile = title + ".csv", audioformat = "flac", audiosamplingrate=16000)

~\.conda\envs\nlp-playground\lib\site-packages\youtube2text-0.0.9a0-py3.8.egg\youtube2text\youtube2text.py in url2text(self, urlpath, outfile, audioformat, audiosamplingrate, asrmode)
    109         textfile = self.__configurepath(textfile, outfilepath, self.textpath)
    110 
--> 111         self.url2audio(urlpath, audiofile = audiofile, audiosamplingrate = audiosamplingrate)
    112         self.audio2text(audiofile = audiofile, textfile = textfile, asrmode = asrmode)
    113 

~\.conda\envs\nlp-playground\lib\site-packages\youtube2text-0.0.9a0-py3.8.egg\youtube2text\youtube2text.py in url2audio(self, urlpath, audiofile, audiosamplingrate)
    152             yt = YouTube(urlpath)
    153 
--> 154             stream_url = yt.streams[0].url
    155 
    156             acodec = 'pcm_s16le' if audioformat == 'wav' else audioformat

~\.conda\envs\nlp-playground\lib\site-packages\pytube-11.0.2-py3.8.egg\pytube\__main__.py in streams(self)
    290         """
    291         self.check_availability()
--> 292         return StreamQuery(self.fmt_streams)
    293 
    294     @property

~\.conda\envs\nlp-playground\lib\site-packages\pytube-11.0.2-py3.8.egg\pytube\__main__.py in fmt_streams(self)
    175         # https://github.com/pytube/pytube/issues/1054
    176         try:
--> 177             extract.apply_signature(stream_manifest, self.vid_info, self.js)
    178         except exceptions.ExtractError:
    179             # To force an update to the js file, we clear the cache and retry

~\.conda\envs\nlp-playground\lib\site-packages\pytube-11.0.2-py3.8.egg\pytube\extract.py in apply_signature(stream_manifest, vid_info, js)
    407 
    408     """
--> 409     cipher = Cipher(js=js)
    410 
    411     for i, stream in enumerate(stream_manifest):

~\.conda\envs\nlp-playground\lib\site-packages\pytube-11.0.2-py3.8.egg\pytube\cipher.py in __init__(self, js)
     41         ]
     42 
---> 43         self.throttling_plan = get_throttling_plan(js)
     44         self.throttling_array = get_throttling_function_array(js)
     45 

~\.conda\envs\nlp-playground\lib\site-packages\pytube-11.0.2-py3.8.egg\pytube\cipher.py in get_throttling_plan(js)
    385         The full function code for computing the throttlign parameter.
    386     """
--> 387     raw_code = get_throttling_function_code(js)
    388 
    389     transform_start = r"try{"

~\.conda\envs\nlp-playground\lib\site-packages\pytube-11.0.2-py3.8.egg\pytube\cipher.py in get_throttling_function_code(js)
    299 
    300     # Extract the code within curly braces for the function itself, and merge any split lines
--> 301     code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n')
    302     joined_lines = "".join(code_lines_list)
    303 

AttributeError: 'NoneType' object has no attribute 'span'
@codenamewei
Copy link
Owner Author

Duplicate of pytube/pytube#1218

@codenamewei codenamewei marked this as a duplicate of pytube/pytube#1218 Feb 5, 2022
@codenamewei
Copy link
Owner Author

Workaround: pytube/pytube#1218 (comment)

@codenamewei codenamewei added bug Something isn't working workaround labels Feb 5, 2022
@codenamewei codenamewei pinned this issue Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workaround
Projects
None yet
Development

No branches or pull requests

1 participant