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 'groups' #479

Closed
atomass opened this issue Jun 16, 2014 · 0 comments
Closed

AttributeError: 'NoneType' object has no attribute 'groups' #479

atomass opened this issue Jun 16, 2014 · 0 comments

Comments

@atomass
Copy link

atomass commented Jun 16, 2014

Hi, thanks for the great job.
I tried your online beautifier against this code

eval(function(p,a,c,k,e,d){while(c--)if(k[c])p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c]);return p}('a 3c="3b.3a.39.38.37";36("2://4.d.5/19-p-35.34");6(g.3==3&&g.3.33.32(\'19\')!=-1){9.3=\'2://4.d.5/p\'}31{8("30").2z({o:"2://15.7.14.13:12/11/v.10",z:"2",18:"2://4.d.5/18/2y.2x",2w:{o:\'2://4.d.5/2v/2u.2t\',2s:\'2://4.d.5/p\'},2r:"2q.2p",2o:"2://4.d.5",2n:"17",2m:1,2l:"2k",2j:"2i",2h:2g,2f:2e,2d:[{f:"17",s:"9.3 = \'<16 2c>/<16 2b>\';/2a/29.28"},{f:"27",26:{o:\'2://15.7.14.13:12/11/v.10\',\'z\':\'2\'}},{f:"25"}]});a j;a i=0;a n=0;a c=0;h=(y.3!=y.24.3)?9.23:9.3;8().22(b(x){6(c>0)n+=x.w-c;c=x.w;6(0!=0&&n>=0){c=-1;8().21();8().20(1z);$(\'#1y\').m();$(\'l.k\').m()}});8().1x(b(x){c=-1});8().1w(b(x){u(x);t()});8().1v(b(){$(\'l.k\').m()});b u(x){$(\'l.k\').1u();6(j)1t;j=1;}b t(){6(i==0){a e=9.1s("1r");e.f="1q/1p";e.s=\'2://4.1o.1n/1m/1l.1k?1j=1i\';9.1h.1g(e);i=1}}6(h.r(\'1f-1e.q\')!=-1){1d(1c)}6(h.r(\'1b.5\')!=-1){g.3=\'2://4.1a.q/\'}}',36,121,'||http|location|www|tv|if||jwplayer|document|var|function|p0151296|rapidvideo|js|type|top|ref_url|first_play|vvplay|video_ad|div|show|tt151296|file|24o0gquf1f4j|net|search|src|show_on_play|doPlay||position||window|provider|mp4|5rzifi5s4wamkzh6rgwcwvdm4qkfklw42cfianycqgwefhf3vvfvkzrnettq|8777|210|161|50|TMPL_VAR|flash|skin|embed|guardaserie|serietv|true|CloseWindows|01|cineblog|appendChild|body|187036|zone|php|display|ad|com|yieldtraffic|javascript|text|script|createElement|return|hide|onComplete|onPlay|onSeek|play_limit_box|false|setFullscreen|stop|onTime|referrer|parent|download|config|html5|swf|player|video_player|file_code|site_url|modes|370|height|896|width|start|startparam|1363|duration|bufferlength|primary|aboutlink|Tv|RapidVideo|abouttext|link|png|video_logo|images|logo|xml|five|setup|jwplayer2|else|indexOf|href|html|896x370|jw_player_fix|avi|ita|hardsub|s01e08|Yonderland|tv_file_name'.split('|')))

and it correctly beautify it. Then I have installed your python library and tested against the same js but this result in an error:

>>> res = jsbeautifier.beautify_file('beautify.js')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/jsbeautifier-1.5.1-py2.7.egg/jsbeautifier/__init__.py", line 231, in beautify_file
    return beautify(''.join(stream.readlines()), opts);
  File "/usr/local/lib/python2.7/dist-packages/jsbeautifier-1.5.1-py2.7.egg/jsbeautifier/__init__.py", line 223, in beautify
    return b.beautify(string, opts)
  File "/usr/local/lib/python2.7/dist-packages/jsbeautifier-1.5.1-py2.7.egg/jsbeautifier/__init__.py", line 352, in beautify
    self.input = self.unpack(s, self.opts.eval_code)
  File "/usr/local/lib/python2.7/dist-packages/jsbeautifier-1.5.1-py2.7.egg/jsbeautifier/__init__.py", line 419, in unpack
    return unpackers.run(source, evalcode)
  File "/usr/local/lib/python2.7/dist-packages/jsbeautifier-1.5.1-py2.7.egg/jsbeautifier/unpackers/__init__.py", line 45, in run
    source = unpacker.unpack(source)
  File "/usr/local/lib/python2.7/dist-packages/jsbeautifier-1.5.1-py2.7.egg/jsbeautifier/unpackers/packer.py", line 27, in unpack
    payload, symtab, radix, count = _filterargs(source)
  File "/usr/local/lib/python2.7/dist-packages/jsbeautifier-1.5.1-py2.7.egg/jsbeautifier/unpackers/packer.py", line 49, in _filterargs
    args = re.search(argsregex, source, re.DOTALL).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

Is there any way to solve this problem?
Thanks in advance

@einars einars closed this as completed in 69be3c0 Jun 16, 2014
@bitwiseman bitwiseman added this to the v1.5.2 milestone Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants