├── Dockerfile ├── LICENSE ├── README.md ├── apps ├── __init__.py └── live_url_api.py ├── config.py ├── flask_server.py ├── routings ├── __init__.py └── live_api_routing.py ├── scripts ├── __init__.py ├── base.py └── lives │ ├── 173.py │ ├── 17live.py │ ├── 2cq.py │ ├── 51lm.py │ ├── 95xiu.py │ ├── 9xiu.py │ ├── __init__.py │ ├── acfun.py │ ├── bigo.py │ ├── bilibili.py │ ├── cc.py │ ├── changyou.py │ ├── douyin.py │ ├── douyu.py │ ├── egame.py │ ├── fengbolive.py │ ├── hongle.py │ ├── huajiao.py │ ├── huomao.py │ ├── huya.py │ ├── imifun.py │ ├── immomo.py │ ├── inke.py │ ├── iqiyi.js │ ├── iqiyi.py │ ├── ixigua.py │ ├── jd.py │ ├── kbs.py │ ├── kk.py │ ├── kuaishou.py │ ├── kugou.py │ ├── kuwo.py │ ├── laifeng.py │ ├── lehai.py │ ├── liveu.py │ ├── longzhu.py │ ├── look.py │ ├── maoer.py │ ├── migu.py │ ├── now.py │ ├── pps.py │ ├── ppsport.py │ ├── qf.py │ ├── qie.py │ ├── renren.py │ ├── showself.py │ ├── sports_iqiyi.py │ ├── tiktok.py │ ├── tuho.py │ ├── twitch.py │ ├── v6cn.py │ ├── wali.py │ ├── woxiu.py │ ├── xunlei.py │ ├── yangshipin.py │ ├── yizhibo.py │ ├── youku.py │ ├── yuanbobo.py │ ├── yy.py │ ├── zhanqi.py │ └── zhibotv.py └── templates ├── LiveUrlDocs.html └── LiveUrlDocs.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8-slim 2 | LABEL maintainer="xgsclear7" 3 | ADD . /real-url-api 4 | WORKDIR /real-url-api 5 | RUN pip install -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple/ 6 | EXPOSE 7000 7 | CMD ["python", "flask_server.py"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 各直播平台直播流接口 2 | 3 | ### 说明 4 | 5 | 看到了wbt5的github仓库[real-url][1],觉得不给写成一个接口着实太麻烦了,花了几小时时间把各个脚本整合成了服务。 6 | 7 | 再次感谢wbt5的开源! 8 | 9 | 项目详情稍后会在我的博客中说明,欢迎大家留言吼。我的博客:[PYDUCK][2] 10 | 11 | #### 支持的平台 12 | 13 | 本项目支持的平台与wbt5的[real-url][1]项目支持的平台一致,因为用的是人家的脚本。 14 | 15 | #### 关于维护 16 | 17 | 由于本身有工作,再加上下班就躺,所以有问题请发issue,我会用上班摸鱼的时间去看。 18 | 19 | ### 运行环境 20 | Docker运行: 21 | ```shell 22 | docker pull miven/real-url-api 23 | docker run -d --restart=always -p 7000:7000 miven/real-url-api 24 | ``` 25 | 首先要有python3.6及以上 26 | 27 | 然后在项目路径下运行: 28 | 29 | ```shell 30 | pip install -r requirements.txt 31 | ``` 32 | 33 | 具体兄弟们自行测试吧,按理说没啥问题。 34 | 35 | ### 部署 36 | 37 | linux可以使用gunicorn部署。 38 | 39 | ```shell 40 | gunicorn -w 4 -b 127.0.0.1:8080 flask_server:app 41 | ``` 42 | 43 | ``` 44 | -c CONFIG, --config=CONFIG 设定配置文件。 45 | -b BIND, --bind=BIND 设定服务需要绑定的端口。建议使用HOST:PORT。 46 | -w WORKERS, --workers=WORKERS 设置工作进程数。建议服务器每一个核心可以设置2-4个。 47 | -k MODULE 选定异步工作方式使用的模块。 48 | ``` 49 | 50 | windows用tornado之类的也可,还是建议直接跑吧。 51 | 52 | ```shell 53 | python flask_server.py 54 | ``` 55 | 56 | mac的话原谅我穷。 57 | 58 | ### 接口地址 59 | 60 | http://api.pyduck.com/live-api/get-url 61 | 62 | 接口免费,服务器性能有限,请爱惜。 63 | 64 | ### 接口文档请访问 65 | 66 | http://api.pyduck.com/live-api/api-docs 67 | 68 | [1]: https://github.com/wbt5/real-url 69 | 70 | [2]: https://www.pyduck.com/ 71 | 72 | [3]: routings/live_api_routing.py 73 | -------------------------------------------------------------------------------- /apps/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /apps/live_url_api.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from flask import Blueprint, render_template 3 | from flask_restful import Resource 4 | from flask_restful import reqparse 5 | from loguru import logger 6 | from routings.live_api_routing import RunScripts 7 | 8 | live_api = Blueprint('live_api', __name__) 9 | 10 | # 响应模板 11 | return_model = {'state': 0, 'data': None} 12 | 13 | 14 | class LiveUrl(Resource): 15 | """ 16 | 直播流接口 17 | """ 18 | 19 | def __init__(self): 20 | self.return_data = return_model 21 | self.reqparse = reqparse.RequestParser() 22 | self.reqparse.add_argument('live_platform', type=str, required=True, help='直播平台') 23 | self.reqparse.add_argument('parameter', type=str, required=True, help='需要解析的内容') 24 | super(LiveUrl, self).__init__() 25 | 26 | def get(self): 27 | # 定义消息体 28 | return_data = self.return_data.copy() 29 | # 接收front参数 30 | args = self.reqparse.parse_args() 31 | live_platform = args.get('live_platform') 32 | parameter = args.get('parameter') 33 | logger.info(f"req: live_platform-{live_platform} parameter-{parameter}") 34 | live_url = RunScripts(live_platform, parameter).choice() 35 | logger.info(f"res: live_platform-{live_platform} parameter-{parameter} res-{live_url}") 36 | if not live_url: 37 | return return_data 38 | return_data['state'] = 1 39 | return_data['data'] = live_url 40 | return return_data 41 | 42 | 43 | class LiveUrlDocs(Resource): 44 | """ 45 | 接口文档 46 | """ 47 | def get(self): 48 | """ 49 | 获取接口文档 50 | :return: 51 | """ 52 | return render_template('LiveUrlDocs.html') 53 | 54 | 55 | live_api.add_url_rule(rule='/api-docs', view_func=LiveUrlDocs.as_view('api-docs')) 56 | live_api.add_url_rule(rule='/get-url', view_func=LiveUrl.as_view('get-live-url')) 57 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 日志模块 3 | from loguru import logger 4 | 5 | logger.add('./Logs/Runtime.log', level='DEBUG', retention='7 days', encoding='utf-8') 6 | logger.add('./Logs/Error.log', level='ERROR', retention='7 days', encoding='utf-8') 7 | 8 | # api配置 9 | API_HOST = '0.0.0.0' 10 | API_PORT = 7000 11 | API_THREADED = True 12 | -------------------------------------------------------------------------------- /flask_server.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from flask import Flask 3 | from flask_restful import Api 4 | 5 | from apps.live_url_api import live_api 6 | from config import * 7 | 8 | # 注册flask 9 | app = Flask(__name__) 10 | # restful 11 | api = Api(app) 12 | # encode 13 | app.config.update(RESTFUL_JSON=dict(ensure_ascii=False)) 14 | app.config['JSON_AS_ASCII'] = False 15 | # registered 16 | app.register_blueprint(live_api, url_prefix='/live-api') 17 | 18 | if __name__ == '__main__': 19 | logger.info(f"server run on {API_HOST}:{API_PORT}. threaded is {'on' if API_THREADED else 'off'}.") 20 | app.run(host=API_HOST, port=API_PORT, threaded=API_THREADED) 21 | -------------------------------------------------------------------------------- /routings/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /routings/live_api_routing.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from loguru import logger 3 | from loguru import logger 4 | from scripts import __all__ as scripts_cls 5 | 6 | 7 | class RunScripts: 8 | 9 | def __init__(self, live_platform, parameter): 10 | self.scripts_cls = scripts_cls 11 | self.live_platform = live_platform 12 | self.parameter = parameter 13 | self.scripts = [scripts(self.parameter) for scripts in self.scripts_cls] 14 | 15 | @logger.catch 16 | def choice(self): 17 | """ 18 | 选择脚本 19 | :return: 20 | """ 21 | for live_platform in self.scripts: 22 | if self.live_platform.upper() == live_platform._name: 23 | logger.info(f'live_platform {live_platform} to get live url.') 24 | data = live_platform.get_real_url() 25 | return data 26 | else: 27 | return 28 | 29 | 30 | if __name__ == '__main__': 31 | print(RunScripts('羚萌', '24003').choice()) 32 | -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import pkgutil 3 | from .base import Base 4 | import inspect 5 | 6 | 7 | # load classes subclass of BaseCrawler 8 | classes = [] 9 | for loader, name, is_pkg in pkgutil.walk_packages(__path__): 10 | module = loader.find_module(name).load_module(name) 11 | for name, value in inspect.getmembers(module): 12 | globals()[name] = value 13 | if inspect.isclass(value) and issubclass(value, Base) and value is not Base \ 14 | and not getattr(value, 'ignore', False): 15 | classes.append(value) 16 | __all__ = __ALL__ = classes -------------------------------------------------------------------------------- /scripts/base.py: -------------------------------------------------------------------------------- 1 | class Base(object): 2 | _name = 'Base' 3 | 4 | def __init__(self): 5 | self.rid = '' 6 | 7 | def get_real_url(self): 8 | return 9 | -------------------------------------------------------------------------------- /scripts/lives/173.py: -------------------------------------------------------------------------------- 1 | # 艺气山直播:http://www.173.com/room/category?categoryId=11 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class YQS(Base): 9 | _name = '艺气山' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | params = 'roomId={}'.format(self.rid) 17 | with requests.Session() as s: 18 | res = s.post('http://www.173.com/room/getVieoUrl', params=params).json() 19 | data = res['data'] 20 | if data: 21 | status = data['status'] 22 | if status == 2: 23 | return data['url'] 24 | else: 25 | return '未开播' 26 | else: 27 | return '直播间不存在' 28 | 29 | 30 | if __name__ == '__main__': 31 | r = input('输入艺气山直播房间号:\n') 32 | print(YQS(r).get_real_url()) 33 | -------------------------------------------------------------------------------- /scripts/lives/17live.py: -------------------------------------------------------------------------------- 1 | # 获取17直播的真实流媒体地址,可能需要挂国外代理才行。 2 | # 17直播间链接形式:https://17.live/live/276480 3 | 4 | import requests 5 | 6 | from scripts.base import Base 7 | 8 | 9 | class Live17(Base): 10 | _name = '17' 11 | 12 | def __init__(self, rid): 13 | super(Base, self).__init__() 14 | self.rid = rid 15 | # 可能需要挂代理。 16 | # self.proxies = { 17 | # "http": "http://xxxx:1080", 18 | # "https": "http://xxxx:1080", 19 | # } 20 | 21 | def get_real_url(self): 22 | try: 23 | response = requests.get(url='https://api-dsa.17app.co/api/v1/lives/' + self.rid).json() 24 | real_url_default = response.get('rtmpUrls')[0].get('url') 25 | real_url_modify = real_url_default.replace('global-pull-rtmp.17app.co', 'china-pull-rtmp-17.tigafocus.com') 26 | real_url = [real_url_modify, real_url_default] 27 | except: 28 | return '直播间不存在或未开播' 29 | return real_url 30 | 31 | 32 | if __name__ == '__main__': 33 | r = input('请输入17直播房间号:\n') 34 | print(Live17(r).get_real_url()) 35 | -------------------------------------------------------------------------------- /scripts/lives/2cq.py: -------------------------------------------------------------------------------- 1 | # 棉花糖直播:https://www.2cq.com/rank 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class MHT(Base): 9 | 10 | _name = '棉花糖' 11 | 12 | def __init__(self, rid): 13 | super(Base, self).__init__() 14 | self.rid = rid 15 | 16 | def get_real_url(self): 17 | with requests.Session() as s: 18 | res = s.get(f'https://www.2cq.com/proxy/room/room/info?roomId={self.rid}&appId=1004') 19 | res = res.json() 20 | if res['status'] == 1: 21 | result = res['result'] 22 | if result['liveState'] == 1: 23 | real_url = result['pullUrl'] 24 | return real_url 25 | else: 26 | return '未开播' 27 | else: 28 | return '直播间可能不存在' 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('输入棉花糖直播房间号:\n') 33 | print(MHT(r).get_real_url()) 34 | -------------------------------------------------------------------------------- /scripts/lives/51lm.py: -------------------------------------------------------------------------------- 1 | # 羚萌直播:https://live.51lm.tv/programs/Hot 2 | 3 | from urllib.parse import urlencode 4 | import requests 5 | import time 6 | import hashlib 7 | from scripts.base import Base 8 | 9 | 10 | class LM(Base): 11 | 12 | _name = '羚萌' 13 | 14 | def __init__(self, rid): 15 | super(Base, self).__init__() 16 | self.rid = rid 17 | 18 | def get_real_url(self): 19 | roominfo = {'programId': self.rid} 20 | 21 | def g(d): 22 | return hashlib.md5((d + '#' + urlencode(roominfo) + '#Ogvbm2ZiKE').encode('utf-8')).hexdigest() 23 | 24 | lminfo = { 25 | 'h': int(time.time()) * 1000, 26 | 'i': -246397986, 27 | 'o': 'iphone', 28 | 's': 'G_c17a64eff3f144a1a48d9f02e8d981c2', 29 | 't': 'H', 30 | 'v': '4.20.43', 31 | 'w': 'a710244508d3cc14f50d24e9fecc496a' 32 | } 33 | u = g(urlencode(lminfo)) 34 | lminfo = 'G=' + u + '&' + urlencode(lminfo) 35 | with requests.Session() as s: 36 | res = s.post('https://www.51lm.tv/live/room/info/basic', json=roominfo, headers={'lminfo': lminfo}).json() 37 | code = res['code'] 38 | if code == 200: 39 | status = res['data']['isLiving'] 40 | if status == 'True': 41 | real_url = res['data']['playUrl'] 42 | return real_url 43 | else: 44 | return '未开播' 45 | elif code == -1: 46 | return '输入错误' 47 | elif code == 1201: 48 | return '直播间不存在' 49 | 50 | 51 | if __name__ == '__main__': 52 | r = input('输入羚萌直播房间号:\n') 53 | print(LM(r).get_real_url()) 54 | -------------------------------------------------------------------------------- /scripts/lives/95xiu.py: -------------------------------------------------------------------------------- 1 | # 95秀:http://www.95.cn/ 2 | 3 | import requests 4 | import re 5 | from scripts.base import Base 6 | 7 | 8 | class JWXiu(Base): 9 | 10 | _name = '95秀' 11 | 12 | def __init__(self, rid): 13 | super(Base, self).__init__() 14 | self.rid = rid 15 | 16 | def get_real_url(self): 17 | with requests.Session() as s: 18 | res = s.get(f'https://www.95.cn/{self.rid}.html').text 19 | try: 20 | uid = re.search(r'"uid":(\d+),', res).group(1) 21 | status = re.search(r'"is_offline":"(\d)"', res).group(1) 22 | except AttributeError: 23 | return '没有找到直播间' 24 | if status == '0': 25 | real_url = f'https://play1.95xiu.com/app/{uid}.flv' 26 | return real_url 27 | else: 28 | return '未开播' 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('输入95秀房间号:\n') 33 | print(JWXiu(r).get_real_url()) 34 | 35 | -------------------------------------------------------------------------------- /scripts/lives/9xiu.py: -------------------------------------------------------------------------------- 1 | # 九秀直播:https://www.9xiu.com/other/classify?tag=all&index=all 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class JXiu(Base): 9 | _name = '九秀' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | with requests.Session() as s: 17 | url = f'https://h5.9xiu.com/room/live/enterRoom?rid={self.rid}' 18 | headers = { 19 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) ' 20 | 'AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' 21 | } 22 | res = s.get(url, headers=headers).json() 23 | if res['code'] == 200: 24 | status = res['data']['status'] 25 | if status == 0: 26 | return '未开播' 27 | elif status == 1: 28 | live_url = res['data']['live_url'] 29 | return live_url 30 | else: 31 | return '直播间可能不存在' 32 | 33 | 34 | if __name__ == '__main__': 35 | r = input('输入九秀直播房间号:\n') 36 | print(JXiu(r).get_real_url()) 37 | -------------------------------------------------------------------------------- /scripts/lives/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /scripts/lives/acfun.py: -------------------------------------------------------------------------------- 1 | # AcFun直播:https://live.acfun.cn/ 2 | # 默认最高画质 3 | 4 | import json 5 | 6 | import requests 7 | 8 | from scripts.base import Base 9 | 10 | 11 | class AcFun(Base): 12 | 13 | _name = 'ACFUN' 14 | 15 | def __init__(self, rid): 16 | super(Base, self).__init__() 17 | self.rid = rid 18 | 19 | def get_real_url(self): 20 | headers = { 21 | 'content-type': 'application/x-www-form-urlencoded', 22 | 'cookie': '_did=H5_', 23 | 'referer': 'https://m.acfun.cn/' 24 | } 25 | url = 'https://id.app.acfun.cn/rest/app/visitor/login' 26 | data = 'sid=acfun.api.visitor' 27 | with requests.Session() as s: 28 | res = s.post(url, data=data, headers=headers).json() 29 | userid = res['userId'] 30 | visitor_st = res['acfun.api.visitor_st'] 31 | 32 | url = 'https://api.kuaishouzt.com/rest/zt/live/web/startPlay' 33 | params = { 34 | 'subBiz': 'mainApp', 35 | 'kpn': 'ACFUN_APP', 36 | 'kpf': 'PC_WEB', 37 | 'userId': userid, 38 | 'did': 'H5_', 39 | 'acfun.api.visitor_st': visitor_st 40 | } 41 | data = 'authorId={}&pullStreamType=FLV'.format(self.rid) 42 | res = s.post(url, params=params, data=data, headers=headers).json() 43 | if res['result'] == 1: 44 | data = res['data'] 45 | videoplayres = json.loads(data['videoPlayRes']) 46 | liveadaptivemanifest, = videoplayres['liveAdaptiveManifest'] 47 | adaptationset = liveadaptivemanifest['adaptationSet'] 48 | representation = adaptationset['representation'][-1] 49 | real_url = representation['url'] 50 | return real_url 51 | else: 52 | return '直播已关闭' 53 | 54 | 55 | if __name__ == '__main__': 56 | r = input('请输入AcFun直播房间号:\n') 57 | print(AcFun(r).get_real_url()) 58 | -------------------------------------------------------------------------------- /scripts/lives/bigo.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/8/15 16:00 3 | # @Project: my-spiders 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import requests 8 | 9 | from scripts.base import Base 10 | 11 | 12 | class bigo(Base): 13 | _name = 'bigo' 14 | 15 | def __init__(self, rid): 16 | super(Base, self).__init__() 17 | self.rid = rid 18 | 19 | def get_real_url(self): 20 | with requests.Session() as s: 21 | url = f'https://ta.bigo.tv/official_website/studio/getInternalStudioInfo' 22 | res = s.post(url, data={'siteId': self.rid}).json() 23 | hls_src = res['data']['hls_src'] 24 | play_url = hls_src if hls_src else '不存在或未开播' 25 | return play_url 26 | 27 | 28 | if __name__ == '__main__': 29 | r = input('输入bigo直播房间号:\n') 30 | print(bigo(r).get_real_url()) 31 | -------------------------------------------------------------------------------- /scripts/lives/bilibili.py: -------------------------------------------------------------------------------- 1 | # 获取哔哩哔哩直播的真实流媒体地址,默认获取直播间提供的最高画质 2 | # qn=150高清 3 | # qn=250超清 4 | # qn=400蓝光 5 | # qn=10000原画 6 | import re 7 | 8 | import requests 9 | from scripts.base import Base 10 | 11 | 12 | class BiliBili(Base): 13 | 14 | _name = '哔哩哔哩' 15 | 16 | def __init__(self, rid): 17 | super(Base, self).__init__() 18 | self.rid = rid 19 | 20 | def get_real_url(self, current_qn: int = 10000): 21 | # 先获取直播状态和真实房间号 22 | header = { 23 | 'User-Agent': 'Mozilla/5.0 (iPod; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.163 Mobile/15E148 Safari/604.1', 24 | } 25 | # 先获取直播状态和真实房间号 26 | r_url = 'https://api.live.bilibili.com/room/v1/Room/room_init' 27 | param = { 28 | 'id': self.rid 29 | } 30 | with requests.Session() as s: 31 | res = s.get(r_url, headers=header, params=param).json() 32 | if res['msg'] == '直播间不存在': 33 | return f'bilibili {self.rid} {res["msg"]}' 34 | live_status = res['data']['live_status'] 35 | if live_status != 1: 36 | return f'bilibili {self.rid} 未开播' 37 | self.real_room_id = res['data']['room_id'] 38 | url = 'https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo' 39 | param = { 40 | 'device': 'pc', 41 | 'platform': 'h5', 42 | 'scale': 0, 43 | 'build': '10000', 44 | 'protocol': '0,1', 45 | 'format': '0,1,2', 46 | 'codec': '0,1', 47 | 'room_id': self.real_room_id, 48 | 'qn': current_qn 49 | } 50 | with requests.Session() as session: 51 | res = session.get(url, headers=header, params=param) 52 | res = res.json() 53 | stream_info = res['data']['playurl_info']['playurl']['stream'] 54 | qn_max = 0 55 | for data in stream_info: 56 | accept_qn = data['format'][0]['codec'][0]['accept_qn'] 57 | for qn in accept_qn: 58 | qn_max = qn if qn > qn_max else qn_max 59 | if qn_max != current_qn: 60 | param['qn'] = qn_max 61 | res = session.get(url, headers=header, params=param) 62 | res = res.json() 63 | stream_info = res['data']['playurl_info']['playurl']['stream'] 64 | stream_url_list = [] 65 | for data in stream_info: 66 | format_name = data['format'][0]['format_name'] 67 | if format_name == 'flv': 68 | base_url = data['format'][0]['codec'][0]['base_url'] 69 | url_info = data['format'][0]['codec'][0]['url_info'] 70 | for info in url_info: 71 | host = info['host'] 72 | extra = info['extra'] 73 | # print(host + base_url + extra) 74 | stream_url_list.append(host + base_url + extra) 75 | break 76 | return stream_url_list 77 | 78 | 79 | if __name__ == '__main__': 80 | r = input('请输入bilibili直播房间号:\n') 81 | print(BiliBili(r).get_real_url()) 82 | -------------------------------------------------------------------------------- /scripts/lives/cc.py: -------------------------------------------------------------------------------- 1 | # 获取网易CC的真实流媒体地址。 2 | # 默认为最高画质 3 | 4 | import requests 5 | 6 | from scripts.base import Base 7 | 8 | 9 | class CC(Base): 10 | _name = '网易CC' 11 | 12 | def __init__(self, rid): 13 | super(Base, self).__init__() 14 | self.rid = rid 15 | 16 | def get_real_url(self): 17 | room_url = 'https://api.cc.163.com/v1/activitylives/anchor/lives?anchor_ccid=' + str(self.rid) 18 | response = requests.get(url=room_url).json() 19 | data = response.get('data', 0) 20 | if data: 21 | channel_id = data.get('{}'.format(self.rid)).get('channel_id', 0) 22 | if channel_id: 23 | response = requests.get('https://cc.163.com/live/channel/?channelids=' + str(channel_id)).json() 24 | real_url = response.get('data')[0].get('sharefile') 25 | else: 26 | return '直播间不存在' 27 | else: 28 | return '输入错误' 29 | return real_url 30 | 31 | 32 | if __name__ == '__main__': 33 | r = input('请输入网易CC直播房间号:\n') 34 | print(CC(r).get_real_url()) 35 | -------------------------------------------------------------------------------- /scripts/lives/changyou.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/1 17:40 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import json 8 | 9 | import requests 10 | 11 | from scripts.base import Base 12 | 13 | 14 | class ChangYou(Base): 15 | 16 | _name = '畅秀阁' 17 | 18 | def __init__(self, rid): 19 | super(Base, self).__init__() 20 | self.rid = rid 21 | 22 | def get_real_url(self): 23 | headers = { 24 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, ' 25 | 'like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 ' 26 | } 27 | url = 'http://cxg.changyou.com/landingpage/getstreamname.action?roomid={}'.format(self.rid) 28 | with requests.Session() as s: 29 | res = s.get(url, headers=headers).json() 30 | try: 31 | code = res['code'] 32 | if code == 'error': 33 | return res['msg'] 34 | else: 35 | stream = res['obj']['stream'] 36 | url = 'http://pull.wscdn.cxg.changyou.com/show/{}.flv'.format(stream) 37 | return url 38 | except json.decoder.JSONDecodeError: 39 | return '输入错误' 40 | 41 | 42 | if __name__ == '__main__': 43 | r = input('请输入畅秀阁roomid:\n') 44 | print(ChangYou(r).get_real_url()) 45 | -------------------------------------------------------------------------------- /scripts/lives/douyin.py: -------------------------------------------------------------------------------- 1 | # 获取抖音直播的真实流媒体地址,默认最高画质。 2 | # 如果知道该直播间如“6779127643792280332”形式的room_id,则直接传入room_id。 3 | # 如果不知道room_id,可以使用手机上打开直播间后,选择“分享--复制链接”,传入如“https://v.douyin.com/qyRqMp/”形式的分享链接。 4 | # 5 | import requests 6 | import re 7 | from scripts.base import Base 8 | 9 | 10 | class DouYin(Base): 11 | 12 | _name = '抖音' 13 | 14 | def __init__(self, rid): 15 | super(Base, self).__init__() 16 | self.rid = rid 17 | 18 | def get_real_url(self): 19 | headers = { 20 | 'authority': 'v.douyin.com', 21 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1', 22 | } 23 | if re.match(r'\d{19}', self.rid): 24 | room_id = self.rid 25 | else: 26 | try: 27 | url = re.search(r'(https.*)', self.rid).group(1) 28 | response = requests.head(url, headers=headers) 29 | url = response.headers['location'] 30 | room_id = re.search(r'\d{19}', url).group(0) 31 | except Exception as e: 32 | return '获取RoomID失败,直播间不存在或未开播或参数错误' 33 | try: 34 | headers.update( 35 | { 36 | 'authority': 'webcast.amemv.com', 37 | 'cookie': '_tea_utm_cache_1128={%22utm_source%22:%22copy%22%2C%22utm_medium%22:%22android%22%2C%22utm_campaign%22:%22client_share%22}', 38 | } 39 | ) 40 | params = ( 41 | ('type_id', '0'), 42 | ('live_id', '1'), 43 | ('room_id', room_id), 44 | ('app_id', '1128'), 45 | ) 46 | response = requests.get('https://webcast.amemv.com/webcast/room/reflow/info/', headers=headers, params=params).json() 47 | rtmp_pull_url = response['data']['room']['stream_url']['rtmp_pull_url'] 48 | hls_pull_url = response['data']['room']['stream_url']['hls_pull_url'] 49 | real_url = [rtmp_pull_url, hls_pull_url] 50 | except: 51 | return '直播间不存在或未开播或参数错误' 52 | return real_url 53 | 54 | 55 | if __name__ == '__main__': 56 | r = input('请输入抖音直播间room_id或分享链接:\n') 57 | print(DouYin(r).get_real_url()) 58 | -------------------------------------------------------------------------------- /scripts/lives/douyu.py: -------------------------------------------------------------------------------- 1 | # 获取斗鱼直播间的真实流媒体地址,默认最高画质 2 | # 使用 https://github.com/wbt5/real-url/issues/185 中两位大佬@wjxgzz @4bbu6j5885o3gpv6ss8找到的的CDN,在此感谢! 3 | import hashlib 4 | import re 5 | import time 6 | 7 | import execjs 8 | import requests 9 | 10 | from scripts.base import Base 11 | 12 | 13 | class DouYu(Base): 14 | """ 15 | 可用来替换返回链接中的主机部分 16 | 两个阿里的CDN: 17 | dyscdnali1.douyucdn.cn 18 | dyscdnali3.douyucdn.cn 19 | 墙外不用带尾巴的akm cdn: 20 | hls3-akm.douyucdn.cn 21 | hlsa-akm.douyucdn.cn 22 | hls1a-akm.douyucdn.cn 23 | """ 24 | 25 | _name = '斗鱼' 26 | 27 | def __init__(self, rid): 28 | """ 29 | 房间号通常为1~7位纯数字,浏览器地址栏中看到的房间号不一定是真实rid. 30 | Args: 31 | rid: 32 | """ 33 | super(Base, self).__init__() 34 | self.rid = rid 35 | 36 | 37 | @staticmethod 38 | def md5(data): 39 | return hashlib.md5(data.encode('utf-8')).hexdigest() 40 | 41 | def get_pre(self): 42 | url = 'https://playweb.douyucdn.cn/lapi/live/hlsH5Preview/' + self.rid 43 | data = { 44 | 'rid': self.rid, 45 | 'did': self.did 46 | } 47 | auth = DouYu.md5(self.rid + self.t13) 48 | headers = { 49 | 'rid': self.rid, 50 | 'time': self.t13, 51 | 'auth': auth 52 | } 53 | res = self.s.post(url, headers=headers, data=data).json() 54 | error = res['error'] 55 | data = res['data'] 56 | key = '' 57 | if data: 58 | rtmp_live = data['rtmp_live'] 59 | key = re.search(r'(\d{1,8}[0-9a-zA-Z]+)_?\d{0,4}(/playlist|.m3u8)', rtmp_live).group(1) 60 | return error, key 61 | 62 | def get_js(self): 63 | result = re.search(r'(function ub98484234.*)\s(var.*)', self.res).group() 64 | func_ub9 = re.sub(r'eval.*;}', 'strc;}', result) 65 | js = execjs.compile(func_ub9) 66 | res = js.call('ub98484234') 67 | 68 | v = re.search(r'v=(\d+)', res).group(1) 69 | rb = DouYu.md5(self.rid + self.did + self.t10 + v) 70 | 71 | func_sign = re.sub(r'return rt;}\);?', 'return rt;}', res) 72 | func_sign = func_sign.replace('(function (', 'function sign(') 73 | func_sign = func_sign.replace('CryptoJS.MD5(cb).toString()', '"' + rb + '"') 74 | 75 | js = execjs.compile(func_sign) 76 | params = js.call('sign', self.rid, self.did, self.t10) 77 | params += '&ver=219032101&rid={}&rate=-1'.format(self.rid) 78 | 79 | url = 'https://m.douyu.com/api/room/ratestream' 80 | res = self.s.post(url, params=params).text 81 | key = re.search(r'(\d{1,8}[0-9a-zA-Z]+)_?\d{0,4}(.m3u8|/playlist)', res).group(1) 82 | 83 | return key 84 | 85 | def get_pc_js(self, cdn='ws-h5', rate=0): 86 | """ 87 | 通过PC网页端的接口获取完整直播源。 88 | :param cdn: 主线路ws-h5、备用线路tct-h5 89 | :param rate: 1流畅;2高清;3超清;4蓝光4M;0蓝光8M或10M 90 | :return: JSON格式 91 | """ 92 | res = self.s.get('https://www.douyu.com/' + str(self.rid)).text 93 | result = re.search(r'(vdwdae325w_64we[\s\S]*function ub98484234[\s\S]*?)function', res).group(1) 94 | func_ub9 = re.sub(r'eval.*?;}', 'strc;}', result) 95 | js = execjs.compile(func_ub9) 96 | res = js.call('ub98484234') 97 | 98 | v = re.search(r'v=(\d+)', res).group(1) 99 | rb = DouYu.md5(self.rid + self.did + self.t10 + v) 100 | 101 | func_sign = re.sub(r'return rt;}\);?', 'return rt;}', res) 102 | func_sign = func_sign.replace('(function (', 'function sign(') 103 | func_sign = func_sign.replace('CryptoJS.MD5(cb).toString()', '"' + rb + '"') 104 | 105 | js = execjs.compile(func_sign) 106 | params = js.call('sign', self.rid, self.did, self.t10) 107 | 108 | params += '&cdn={}&rate={}'.format(cdn, rate) 109 | url = 'https://www.douyu.com/lapi/live/getH5Play/{}'.format(self.rid) 110 | res = self.s.post(url, params=params).json() 111 | 112 | return res 113 | 114 | def get_real_url(self): 115 | self.did = '10000000000000000000000000001501' 116 | self.t10 = str(int(time.time())) 117 | self.t13 = str(int((time.time() * 1000))) 118 | 119 | self.s = requests.Session() 120 | self.res = self.s.get('https://m.douyu.com/' + str(self.rid)).text 121 | result = re.search(r'rid":(\d{1,8}),"vipId', self.res) 122 | 123 | if result: 124 | self.rid = result.group(1) 125 | else: 126 | return '房间号错误' 127 | error, key = self.get_pre() 128 | if error == 0: 129 | pass 130 | elif error == 102: 131 | return '房间不存在' 132 | elif error == 104: 133 | return '房间未开播' 134 | else: 135 | key = self.get_js() 136 | real_url = {} 137 | real_url["flv"] = "http://dyscdnali1.douyucdn.cn/live/{}.flv?uuid=".format(key) 138 | real_url["x-p2p"] = "http://tx2play1.douyucdn.cn/live/{}.xs?uuid=".format(key) 139 | return real_url 140 | 141 | 142 | if __name__ == '__main__': 143 | r = input('输入斗鱼直播间号:\n') 144 | s = DouYu(r) 145 | print(s.get_real_url()) 146 | -------------------------------------------------------------------------------- /scripts/lives/egame.py: -------------------------------------------------------------------------------- 1 | # 获取企鹅电竞的真实流媒体地址。 2 | # 默认画质为超清 3 | 4 | import requests 5 | import re 6 | from scripts.base import Base 7 | 8 | 9 | class EGame(Base): 10 | 11 | _name = '企鹅电竞' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | room_url = 'https://share.egame.qq.com/cgi-bin/pgg_async_fcgi' 19 | post_data = { 20 | 'param': '''{"0":{"module":"pgg_live_read_svr","method":"get_live_and_profile_info","param":{"anchor_id":''' 21 | + str(self.rid) + ''',"layout_id":"hot","index":1,"other_uid":0}}}''' 22 | } 23 | try: 24 | response = requests.post(url=room_url, data=post_data).json() 25 | data = response.get('data', 0) 26 | if data: 27 | video_info = data.get('0').get( 28 | 'retBody').get('data').get('video_info') 29 | pid = video_info.get('pid', 0) 30 | if pid: 31 | is_live = data.get('0').get( 32 | 'retBody').get('data').get('profile_info').get('is_live', 0) 33 | if is_live: 34 | play_url = video_info.get('stream_infos')[ 35 | 0].get('play_url') 36 | real_url = re.findall(r'([\w\W]+?)&uid=', play_url)[0] 37 | else: 38 | return '直播间未开播' 39 | else: 40 | return '直播间未启用' 41 | else: 42 | return '直播间不存在' 43 | except: 44 | return '数据请求错误' 45 | return real_url 46 | 47 | 48 | if __name__ == '__main__': 49 | r = input('请输入企鹅电竞房间号:\n') 50 | print(EGame(r).get_real_url()) 51 | -------------------------------------------------------------------------------- /scripts/lives/fengbolive.py: -------------------------------------------------------------------------------- 1 | # 新浪疯播直播:http://www.fengbolive.com/list?type=hot 2 | # 链接样式:http://www.fengbolive.com/live/88057518 3 | 4 | from Crypto.Cipher import AES 5 | from urllib.parse import unquote 6 | import base64 7 | import json 8 | import requests 9 | 10 | from scripts.base import Base 11 | 12 | 13 | class FengBo(Base): 14 | 15 | _name = '新浪疯播' 16 | 17 | def __init__(self, rid): 18 | super(Base, self).__init__() 19 | self.rid = rid 20 | 21 | def get_real_url(self): 22 | with requests.Session() as s: 23 | res = s.get('https://external.fengbolive.com/cgi-bin/get_anchor_info_proxy.fcgi?anchorid=' + str(self.rid)).json() 24 | if res['ret'] == 1: 25 | info = res['info'] 26 | info = unquote(info, 'utf-8') 27 | 28 | # 开始AES解密 29 | def pad(t): 30 | return t + (16 - len(t) % 16) * b'\x00' 31 | 32 | key = iv = 'abcdefghqwertyui'.encode('utf8') 33 | cipher = AES.new(key, AES.MODE_CBC, iv) 34 | info = info.encode('utf8') 35 | info = pad(info) 36 | result = cipher.decrypt(base64.decodebytes(info)).rstrip(b'\0') 37 | 38 | result = json.loads(result.decode('utf-8')) 39 | url = result['url'] 40 | url = url.replace('hdl', 'hls') 41 | url = url.replace('.flv', '/playlist.m3u8') 42 | return url 43 | else: 44 | return '房间号错误' 45 | 46 | 47 | if __name__ == '__main__': 48 | r = input('输入疯播直播房间号:\n') 49 | print(FengBo(r).get_real_url()) 50 | -------------------------------------------------------------------------------- /scripts/lives/hongle.py: -------------------------------------------------------------------------------- 1 | # 红人直播:https://www.hongle.tv/ 2 | # 该平台需登陆,下面代码中已集成一个账号的登陆方式; 3 | # 如登陆信息过期,可用自己的账号登陆后,查找浏览器Local Storage中的hrtk字段,替换代码中的accesstoken 4 | 5 | import hashlib 6 | import json 7 | import time 8 | from urllib.parse import unquote 9 | from urllib.parse import urlencode 10 | 11 | import requests 12 | 13 | from scripts.base import Base 14 | 15 | 16 | class HongLe(Base): 17 | _name = '红人' 18 | 19 | def __init__(self, rid): 20 | super(Base, self).__init__() 21 | self.rid = rid 22 | 23 | def get_real_url(self): 24 | # 模拟登陆 25 | with requests.Session() as s: 26 | pass 27 | 28 | tt = int(time.time() * 1000) 29 | url = 'https://service.hongle.tv/v2/userw/login?_st1={}'.format(tt) 30 | data = { 31 | '_st1': tt, 32 | 'geetest_challenge': '7f4f6fd6257799c0bcac1f38c21c042dl0', 33 | 'geetest_seccode': 'd1163915f4cfd6c998014c4ca8899c9d|jordan', 34 | 'geetest_validate': 'd1163915f4cfd6c998014c4ca8899c9d', 35 | 'name': '16530801176', 36 | 'password': 'QTXz9/Sp40BbMHwVtcb7AQ==', 37 | } 38 | 39 | data1 = urlencode(data) + 'yuj1ah5o' 40 | _ajaxdata1 = hashlib.md5(data1.encode('utf-8')).hexdigest() 41 | data['_ajaxData1'] = _ajaxdata1 42 | del data['_st1'] 43 | data = json.dumps(data, separators=(',', ':')) 44 | headers = {'Content-Type': 'application/x-www-form-urlencoded'} 45 | res = s.post(url, data=data, headers=headers).json() 46 | if res['status']['statuscode'] == '0': 47 | sessionid = res['data']['sessionid'] 48 | else: 49 | return '登陆信息过期' 50 | 51 | url = 'https://service.hongle.tv/v2/roomw/media' 52 | accesstoken = sessionid 53 | params = { 54 | '_st1': tt, 55 | 'accessToken': accesstoken, 56 | 'of': 1, 57 | 'showid': self.rid, 58 | 'tku': 43112608, 59 | } 60 | data = urlencode(params) + 'yuj1ah5o' 61 | _ajaxData1 = hashlib.md5(data.encode('utf-8')).hexdigest() 62 | params['_ajaxData1'] = _ajaxData1 63 | params['accessToken'] = unquote(accesstoken) 64 | 65 | res = s.get(url, params=params) 66 | if res.status_code == 200: 67 | res = res.json() 68 | statuscode = res['status']['statuscode'] 69 | if statuscode == '0': 70 | if res['data']['live_status'] == '1': 71 | real_url = res['data']['media_url_web'] 72 | real_url = real_url.replace('http', 'https') 73 | real_url = real_url.replace('__', '&') 74 | return real_url 75 | else: 76 | return '未开播' 77 | else: 78 | return '房间不存在' 79 | else: 80 | return '参数错误' 81 | 82 | 83 | if __name__ == '__main__': 84 | r = input('输入红人直播房间号:\n') 85 | print(HongLe(r).get_real_url()) 86 | -------------------------------------------------------------------------------- /scripts/lives/huajiao.py: -------------------------------------------------------------------------------- 1 | # 获取花椒直播的真实流媒体地址。 2 | 3 | import requests 4 | import time 5 | from scripts.base import Base 6 | 7 | 8 | class HuaJiao(Base): 9 | _name = '花椒' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | self.headers = { 15 | 'Referer': 'https://h.huajiao.com/l/index?liveid={}&qd=hu'.format(rid) 16 | } 17 | 18 | def get_real_url(self): 19 | tt = str(time.time()) 20 | try: 21 | room_url = 'https://h.huajiao.com/api/getFeedInfo?sid={tt}&liveid={rid}'.format(tt=tt, rid=self.rid) 22 | response = requests.get(url=room_url, headers=self.headers).json() 23 | real_url = response.get('data').get('live').get('main') 24 | except: 25 | return '直播间不存在或未开播' 26 | return real_url 27 | 28 | 29 | if __name__ == '__main__': 30 | r = input('请输入花椒直播房间号:\n') 31 | print(HuaJiao(r).get_real_url()) 32 | -------------------------------------------------------------------------------- /scripts/lives/huomao.py: -------------------------------------------------------------------------------- 1 | # 获取火猫直播的真实流媒体地址,默认为最高画质. 2 | # 获取的流媒体地址如:http://live-lx-hdl.huomaotv.cn/live/qvCESZ?t=1573928152&r=377789475848&stream=qvCESZ&rid=oubvc2y3v&token=44a7f115f0af496e268bcbb7cdbb63b1&url=http%3A%2F%2Flive-lx-hdl.huomaotv.cn%2Flive%2FqvCESZ&from=huomaoh5room 3 | # 实际上使用http://live-lx-hdl.huomaotv.cn/live/qvCESZ?token=44a7f115f0af496e268bcbb7cdbb63b1,即可播放 4 | # 链接中lx可替换cdn(lx,tx,ws,js,jd2等),媒体类型可为.flv或.m3u8,码率可为BL8M,BL4M,TD,BD,HD,SD 5 | 6 | import requests 7 | import time 8 | import hashlib 9 | import re 10 | from scripts.base import Base 11 | 12 | 13 | class HuoMao(Base): 14 | _name = '火猫' 15 | 16 | def __init__(self, rid): 17 | super(Base, self).__init__() 18 | self.rid = rid 19 | 20 | @staticmethod 21 | def get_time(): 22 | tt = str(int((time.time() * 1000))) 23 | return tt 24 | 25 | @staticmethod 26 | def get_videoids(rid): 27 | room_url = 'https://www.huomao.com/mobile/mob_live/' + str(rid) 28 | response = requests.get(url=room_url).text 29 | try: 30 | videoids = re.findall(r'var stream = "([\w\W]+?)";', response)[0] 31 | except: 32 | videoids = 0 33 | return videoids 34 | 35 | @staticmethod 36 | def get_token(videoids, time): 37 | token = hashlib.md5((str(videoids) + 'huomaoh5room' + str(time) + 38 | '6FE26D855E1AEAE090E243EB1AF73685').encode('utf-8')).hexdigest() 39 | return token 40 | 41 | def get_real_url(self): 42 | videoids = self.get_videoids(self.rid) 43 | if videoids: 44 | time = self.get_time() 45 | token = self.get_token(videoids, time) 46 | room_url = 'https://www.huomao.com/swf/live_data' 47 | post_data = { 48 | 'cdns': 1, 49 | 'streamtype': 'live', 50 | 'VideoIDS': videoids, 51 | 'from': 'huomaoh5room', 52 | 'time': time, 53 | 'token': token 54 | } 55 | response = requests.post(url=room_url, data=post_data).json() 56 | roomStatus = response.get('roomStatus', 0) 57 | if roomStatus == '1': 58 | real_url_flv = response.get('streamList')[-1].get('list')[0].get('url') 59 | real_url_m3u8 = response.get('streamList')[-1].get('list_hls')[0].get('url') 60 | real_url = [real_url_flv, real_url_m3u8.replace('_480', '')] 61 | else: 62 | return '直播间未开播' 63 | else: 64 | return '直播间不存在' 65 | return real_url 66 | 67 | 68 | if __name__ == '__main__': 69 | r = input('请输入火猫直播房间号:\n') 70 | print(HuoMao(r).get_real_url()) 71 | -------------------------------------------------------------------------------- /scripts/lives/huya.py: -------------------------------------------------------------------------------- 1 | # 获取虎牙直播的真实流媒体地址。 2 | # 虎牙"一起看"频道的直播间可能会卡顿,尝试将返回地址 tx.hls.huya.com 中的 tx 改为 bd、migu-bd。 3 | import base64 4 | import hashlib 5 | import json 6 | import re 7 | import time 8 | import urllib.parse 9 | 10 | import requests 11 | 12 | from scripts.base import Base 13 | 14 | 15 | class HuYa(Base): 16 | _name = '虎牙' 17 | 18 | def __init__(self, rid): 19 | super(Base, self).__init__() 20 | self.rid = rid 21 | 22 | def live(self, e): 23 | i, b = e.split('?') 24 | r = i.split('/') 25 | s = re.sub(r'.(flv|m3u8)', '', r[-1]) 26 | c = b.split('&', 3) 27 | c = [i for i in c if i != ''] 28 | n = {i.split('=')[0]: i.split('=')[1] for i in c} 29 | fm = urllib.parse.unquote(n['fm']) 30 | u = base64.b64decode(fm).decode('utf-8') 31 | p = u.split('_')[0] 32 | f = str(int(time.time() * 1e7)) 33 | l = n['wsTime'] 34 | t = '0' 35 | h = '_'.join([p, t, s, f, l]) 36 | m = hashlib.md5(h.encode('utf-8')).hexdigest() 37 | y = c[-1] 38 | url = "{}?wsSecret={}&wsTime={}&u={}&seqid={}&{}".format(i, m, l, t, f, y) 39 | return url 40 | 41 | def get_real_url(self): 42 | try: 43 | room_url = 'https://m.huya.com/' + str(self.rid) 44 | header = { 45 | 'Content-Type': 'application/x-www-form-urlencoded', 46 | 'User-Agent': 'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) ' 47 | 'Chrome/75.0.3770.100 Mobile Safari/537.36 ' 48 | } 49 | response = requests.get(url=room_url, headers=header).text 50 | liveLineUrl = re.findall(r'"liveLineUrl":"([\s\S]*?)",', response)[0] 51 | liveline = base64.b64decode(liveLineUrl).decode('utf-8') 52 | if liveline: 53 | if 'replay' in liveline: 54 | return '直播录像:' + liveline 55 | else: 56 | liveline = self.live(liveline) 57 | real_url = ("https:" + liveline).replace("hls", "flv").replace("m3u8", "flv") 58 | else: 59 | real_url = '未开播或直播间不存在' 60 | except: 61 | real_url = '未开播或直播间不存在' 62 | return real_url 63 | 64 | 65 | if __name__ == '__main__': 66 | rid = input('输入虎牙直播房间号:\n') 67 | print(HuYa(rid).get_real_url()) 68 | -------------------------------------------------------------------------------- /scripts/lives/imifun.py: -------------------------------------------------------------------------------- 1 | # 艾米直播:https://www.imifun.com/ 2 | 3 | import re 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class IMFun(Base): 11 | _name = '艾米' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | with requests.Session() as s: 19 | res = s.get('https://www.imifun.com/' + str(self.rid)).text 20 | roomid = re.search(r"roomId:\s'([\w-]+)'", res) 21 | if roomid: 22 | status = re.search(r"isLive:(\d),", res).group(1) 23 | if status == '1': 24 | real_url = 'https://wsmd.happyia.com/ivp/{}.flv'.format(roomid.group(1)) 25 | return real_url 26 | else: 27 | return '未开播' 28 | else: 29 | return '直播间不存在' 30 | 31 | 32 | if __name__ == '__main__': 33 | r = input('输入艾米直播房间号:\n') 34 | print(IMFun(r).get_real_url()) 35 | -------------------------------------------------------------------------------- /scripts/lives/immomo.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from scripts.base import Base 4 | 5 | 6 | class ImMoMo(Base): 7 | _name = '陌陌' 8 | 9 | def __init__(self, rid): 10 | super(Base, self).__init__() 11 | self.rid = rid 12 | 13 | def get_real_url(self): 14 | url = 'https://web.immomo.com/webmomo/api/scene/profile/roominfos' 15 | data = { 16 | 'stid': self.rid, 17 | 'src': 'url' 18 | } 19 | 20 | with requests.Session() as s: 21 | s.get('https://web.immomo.com') 22 | res = s.post(url, data=data).json() 23 | 24 | ec = res.get('ec', 0) 25 | if ec != 200: 26 | return '请求参数错误' 27 | else: 28 | live = res['data']['live'] 29 | if live: 30 | real_url = res['data']['url'] 31 | return real_url 32 | else: 33 | return '未开播' 34 | 35 | 36 | if __name__ == '__main__': 37 | r = input('请输入陌陌直播房间号:\n') 38 | print(ImMoMo(r).get_real_url()) 39 | -------------------------------------------------------------------------------- /scripts/lives/inke.py: -------------------------------------------------------------------------------- 1 | # 获取映客直播的真实流媒体地址。 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class InKe(Base): 9 | _name = '映客' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | try: 17 | room_url = 'https://webapi.busi.inke.cn/web/live_share_pc?uid=' + str(self.rid) 18 | response = requests.get(url=room_url).json() 19 | record_url = response.get('data').get('file').get('record_url') 20 | stream_addr = response.get('data').get('live_addr') 21 | real_url = { 22 | 'record_url': record_url, 23 | 'stream_addr': stream_addr 24 | } 25 | except: 26 | return '直播间不存在或未开播' 27 | return real_url 28 | 29 | 30 | if __name__ == '__main__': 31 | r = input('请输入映客直播房间号:\n') 32 | print(InKe(r).get_real_url()) 33 | -------------------------------------------------------------------------------- /scripts/lives/iqiyi.js: -------------------------------------------------------------------------------- 1 | function cmd5x(ba){if(typeof(ArrayBuffer)=="undefined"||typeof(Float64Array)=="undefined"||typeof(Uint8Array)=="undefined"){return"iloveiqiyi"}var bq=new ArrayBuffer(16384),av=5136,ai=new Int32Array(bq),ah=new Uint8Array(bq),bj=new Int8Array(bq),bd=new Int32Array(bq),a3=1760,aL=0,aJ=0,aI=0,aT=0,bv=0,a7=0,aU=0,bU=0,a2=0,bR=0,bD=0,bu=0,bk=0,bW=0,bI=0,bQ=0,br=0,aH=0,bP=0,bO=0,bL=0,bH=0,bG=0,bF=Math.floor,bB=Math.abs,bJ=Math.min,b2=0;ai[0]=255;var bm=Math.imul||function(d,c){return(((d&65535)*(c&65535))+(((((d>>>16)&65535)*(c&65535)+(d&65535)*((c>>>16)&65535))<<16)>>>0)|0)};for(var aV=0,aN=0;aN=55296&&aU<=57343&&(aU=65536+((1023&aU)<<10)|1023&ba.charCodeAt(++aN)),aU<=127?++aV:aV+=aU<=2047?2:aU<=65535?3:aU<=2097151?4:aU<=67108863?5:6}var aO=new Array(aV+1),aP=0;ai[51]=3920,ai[54]=8328;for(var a9=aP+aV,aN=0;aN=55296&&aU<=57343&&(aU=65536+((1023&aU)<<10)|1023&ba.charCodeAt(++aN)),aU<=127){if(aP>=a9){break}aO[aP++]=aU}else{if(aU<=2047){if(aP+1>=a9){break}aO[aP++]=192|aU>>6,aO[aP++]=128|63&aU}else{if(aU<=65535){if(aP+2>=a9){break}aO[aP++]=224|aU>>12,aO[aP++]=128|aU>>6&63,aO[aP++]=128|63&aU}else{if(aU<=2097151){if(aP+3>=a9){break}aO[aP++]=240|aU>>18,aO[aP++]=128|aU>>12&63,aO[aP++]=128|aU>>6&63,aO[aP++]=128|63&aU}else{if(aU<=67108863){if(aP+4>=a9){break}aO[aP++]=248|aU>>24,aO[aP++]=128|aU>>18&63,aO[aP++]=128|aU>>12&63,aO[aP++]=128|aU>>6&63,aO[aP++]=128|63&aU}else{if(aP+5>=a9){break}aO[aP++]=252|aU>>30,aO[aP++]=128|aU>>24&63,aO[aP++]=128|aU>>18&63,aO[aP++]=128|aU>>12&63,aO[aP++]=128|aU>>6&63,aO[aP++]=128|63&aU}}}}}}aO[aP]=0,ah.set(aO,av),ba=av;var aM=0,bh=0,a1=0,aZ=0,bb=0,aK=0,a4=0,aW=0,aL=0,aJ=0,aI=0,aT=0,bX=0,aR=0,bv=0,a7=0,aU=0,bU=0,a2=0,bR=0,bD=0,bu=0,bk=0,bW=0,bI=0,bQ=0,br=0,aH=0,bP=0,bO=0,bL=0,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224|0,aj=ch+228|0,cm=ch+232|0,aw=ch+236|0,ap=ch+240|0,b5=ch+244|0,aD=ch+248|0,cs=ch+252|0,a1=78,am=0,aq=0,b2=0,bC=0,ay=0,aY=0,cq=0,ct=0,ad=0,b3=0,bK=0,az=0,bZ=0,bh=0,aM=0,bY=0,ak=0,cn=0,b6=0,a6=0;ba:for(;;){switch(0|a1){case 62:break ba;case 145:an=136;break ba;case 112:cr=a6,cb=b6,a8=cn,bV=ak,b1=bY,bM=aM,a0=bh,aS=bZ,ag=az,bN=bK,ab=b3,au=ad,aG=ct,bl=cq,cf=ay,aE=bC,bg=b2,bT=aq,aZ=am,a1=99,aY=0|bd[aB+(cn+1588902052+-1+-1588902052+-1250383377-am+1250383377<<2)>>2],a6=cr,b6=cb,cn=a8,ak=bV,bY=b1,aM=bM,bh=a0,bZ=aS,az=ag,bK=bN,b3=ab,ad=au,ct=aG,cq=bl,ay=cf,bC=aE,b2=bg,aq=bT,am=aZ;continue ba;case 111:ck=a6,aZ=b6,bT=cn,bg=ak,aE=bY,cf=aM,bl=bh,aG=bZ,au=az,ab=bK,bN=b3,ag=ad,aS=ct,a0=cq,bM=aY,b1=ay,bV=bC,a8=b2,cb=aq,cr=am,a1=(0|cn)==(0|am)?110:107,a6=ck,b6=aZ,cn=bT,ak=bg,bY=aE,aM=cf,bh=bl,bZ=aG,az=au,bK=ab,b3=bN,ad=ag,ct=aS,cq=a0,aY=bM,ay=b1,bC=bV,b2=a8,aq=cb,am=cr;continue ba;case 110:aZ=a6,bT=b6,bg=cn,aE=ak,cf=bY,bl=aM,aG=bh,au=bZ,ab=az,bN=bK,ag=b3,aS=ad,a0=ct,bM=cq,b1=aY,bV=ay,a8=bC,cb=b2,cr=aq,ck=am,a1=(0|bh)>0?109:107,a6=aZ,b6=bT,cn=bg,ak=aE,bY=cf,aM=bl,bh=aG,bZ=au,az=ab,bK=bN,b3=ag,ad=aS,ct=a0,cq=bM,aY=b1,ay=bV,bC=a8,b2=cb,aq=cr,am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cb,aq=cr,am=ck; 2 | continue ba;case 104:a1=ad-520486856+40+520486856>>6<<4,aZ=a6,bT=b6,bg=cn,aE=ak,cf=bY,bl=aM,aG=bh,au=bZ,ab=az,bN=bK,ag=b3,aS=ad,a0=ct,bM=cq,b1=aY,bV=ay,a8=bC,cb=b2,cr=aq,ck=am,a1=(0|cn)==(14&a1|14^a1|0)?103:102,a6=aZ,b6=bT,cn=bg,ak=aE,bY=cf,aM=bl,bh=aG,bZ=au,az=ab,bK=bN,b3=ag,ad=aS,ct=a0,cq=bM,aY=b1,ay=bV,bC=a8,b2=cb,aq=cr,am=ck;continue ba;case 103:bT=a6,bg=b6,aE=cn,cf=ak,bl=bY,aG=aM,au=bh,ab=bZ,bN=az,ag=bK,aS=b3,a0=ad,bM=ct,b1=cq,bV=ay,a8=bC,cb=b2,cr=aq,ck=am,a1=99,aY=(ad<<3)-906020365+256+906020365|0,a6=bT,b6=bg,cn=aE,ak=cf,bY=bl,aM=aG,bh=au,bZ=ab,az=bN,bK=ag,b3=aS,ad=a0,ct=bM,cq=b1,ay=bV,bC=a8,b2=cb,aq=cr,am=ck;continue ba;case 102:aZ=a6,bT=b6,bg=cn,aE=ak,cf=bY,bl=aM,aG=bh,au=bZ,ab=az,bN=bK,ag=b3,aS=ad,a0=ct,bM=cq,b1=aY,bV=ay,a8=bC,cb=b2,cr=aq,ck=am,a1=(0|cn)>(am-2136007327+1+2136007327|0)?101:100,a6=aZ,b6=bT,cn=bg,ak=aE,bY=cf,aM=bl,bh=aG,bZ=au,az=ab,bK=bN,b3=ag,ad=aS,ct=a0,cq=bM,aY=b1,ay=bV,bC=a8,b2=cb,aq=cr,am=ck;continue ba;case 101:bT=a6,bg=b6,aE=cn,cf=ak,bl=bY,aG=aM,au=bh,ab=bZ,bN=az,ag=bK,aS=b3,a0=ad,bM=ct,b1=cq,bV=ay,a8=bC,cb=b2,cr=aq,ck=am,a1=99,aY=0,a6=bT,b6=bg,cn=aE,ak=cf,bY=bl,aM=aG,bh=au,bZ=ab,az=bN,bK=ag,b3=aS,ad=a0,ct=bM,cq=b1,ay=bV,bC=a8,b2=cb,aq=cr,am=ck;continue ba;case 100:bT=a6,bg=b6,aE=cn,cf=ak,bl=bY,aG=aM,au=bh,ab=bZ,bN=az,ag=bK,aS=b3,a0=ad,bM=ct,b1=cq,bV=ay,a8=bC,cb=b2,cr=aq,ck=am,a1=99,aY=0|bd[a6+(cn<<2)>>2],a6=bT,b6=bg,cn=aE,ak=cf,bY=bl,aM=aG,bh=au,bZ=ab,az=bN,bK=ag,b3=aS,ad=a0,ct=bM,cq=b1,ay=bV,bC=a8,b2=cb,aq=cr,am=ck;continue ba;case 99:am=0|bd[ch+(ct<<2)>>2],bY=-1&~(1|~(((1^am)&am)-(0-aY))),bg=(-2^am)&am,bT=~bY,aE=~bg,cn=1404706963,cn=((-1404706964&bT|bY&cn)^(-1404706964&aE|bg&cn)|~(bT|aE)&(-1404706964|cn))-(0-((-2^aY)&aY))|0,aE=-1&~(1|~(0-(0-cn+(0-((1^ak)&ak))))),bT=(-2^ak)&ak,bg=~aE,bY=~bT,aG=405859794,am=0-(0-((-405859795&bg|aE&aG)^(-405859795&bY|bT&aG)|~(bg|bY)&(-405859795|aG))+(0-(-1&~(-2|~(am+125479053+aY-125479053)))))|0,aG=(0|ct)%4|0,aG=0-(0-(aG<<2)-1639813410)-1628865018+((0|bm(aG+-946902778+-1+946902778|0,aG))/2|0)+1628865018|0,bY=aG+-705355747+-1639813405+705355747|0,bg=am<>>(-135710764-aG+1775524201|0),aG=bg&aG|bg^aG,bg=(-2^b2)&b2,bT=0-(0-b2-1859242102)|0,bT=-1&~(1|~(403699684+((1^bT)&bT)+aG+-403699684)),aE=~bT,cf=~bg,bl=2075741682,al=-1&~(-2|~aG),bw=~al,bi=1859242101,aZ=1973195179,au=a6,ab=b6,bN=ak,ag=aM,aS=bh,a0=bZ,bM=az,b1=bK,bV=b3,a8=ad,cb=cq,cr=bC,ck=b2,aq=ay,a1=119,b2=0-(0-((-1973195180&bw|al&aZ)^(-1973195180&bi|-1859242102&aZ)|~(bw|bi)&(-1973195180|aZ))+(0-((-2075741683&aE|bT&bl)^(-2075741683&cf|bg&bl)|~(aE|cf)&(-2075741683|bl))))|0,aY=aG,ct=0-(0-ct-1)|0,a6=au,b6=ab,ak=bN,aM=ag,bh=aS,bZ=a0,az=bM,bK=b1,b3=bV,ad=a8,cq=cb,ay=cr,bC=ck;continue ba;case 97:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|ct)<48?95:63,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 95:aE=b2&~bC|bC&~b2,ak=1719848736,ak=(-1719848737&~aE|aE&ak)^(-1719848737&~ay|ay&ak),aE=0-(0-(-1&~(1|~aq))+(0-ak))|0,aE&=1^aE,cf=(-2^aq)&aq,bl=~aE,aG=~cf,cn=-373881475,au=a6,ab=b6,bN=bY,ag=aM,aS=bh,a0=bZ,bM=az,b1=bK,bV=b3,a8=ad,cb=ct,cr=cq,ck=ay,bi=bC,bw=b2,al=aq,a1=94,am=0-(0-ad+1)>>2,aY=ak,ak=((373881474&bl|aE&cn)^(373881474&aG|cf&cn)|~(bl|aG)&(373881474|cn))-(0-(-1&~(-2|~ak)))|0,cn=((0-(0-(3*ct|0)-5)|0)%16|0)-169207214+cq+169207214|0,a6=au,b6=ab,bY=bN,aM=ag,bh=aS,bZ=a0,az=bM,bK=b1,b3=bV,ad=a8,ct=cb,cq=cr,ay=ck,bC=bi,b2=bw,aq=al;continue ba;case 94:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=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=al;continue ba;case 85:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)>(0-(0-am-1)|0)?84:83,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 84:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=75,aY=0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 83:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=75,aY=0|bd[a6+(cn<<2)>>2],a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 82:aZ=ad+430907182+40-430907182>>6<<4,bT=~aZ,bg=-15,a1=2004298389,aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)==((-2004298390&bT|aZ&a1)^(-2004298390&bg|14&a1)|~(bT|bg)&(-2004298390|a1)|0)?81:80,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 81:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=75,aY=(ad<<3)- -256|0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 80:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)>(0-(0-am-1)|0)?79:77,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 79:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=75,aY=0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 78:bd[ch>>2]=-680876936,bd[bb>>2]=-389564586,bd[aK>>2]=606105819,bd[aU>>2]=-1044525330,bd[aH>>2]=-176418897,bd[bs>>2]=1200080426,bd[bS>>2]=-1473231341,bd[bA>>2]=-45705983,bd[cd>>2]=1770035416,bd[aA>>2]=-1958414417,bd[cj>>2]=-42063,bd[a4>>2]=-1990404162,bd[aW>>2]=1804603682,bd[aL>>2]=-40341101,bd[aJ>>2]=-1502002290,bd[aI>>2]=1236535329,bd[aT>>2]=-165796510,bd[bX>>2]=-1069501632,bd[aR>>2]=643717713,bd[bv>>2]=-373897302,bd[a7>>2]=-701558691,bd[bU>>2]=38016083,bd[a2>>2]=-660478335,bd[bR>>2]=-405537848,bd[bD>>2]=568446438,bd[bu>>2]=-1019803690,bd[bk>>2]=-187363961,bd[bW>>2]=1163531501,bd[bI>>2]=-1444681467,bd[bQ>>2]=-51403784,bd[br>>2]=1735328473,bd[bP>>2]=-1926607734,bd[bO>>2]=-378558,bd[bL>>2]=-2022574463,bd[bH>>2]=1839030562,bd[bG>>2]=-35309556,bd[bF>>2]=-1530992060,bd[bB>>2]=1272893353,bd[bz>>2]=-155497632,bd[by>>2]=-1094730640,bd[bx>>2]=681279174,bd[bq>>2]=-358537222,bd[bp>>2]=-722521979,bd[bo>>2]=76029189,bd[bn>>2]=-640364487,bd[ca>>2]=-421815835,bd[af>>2]=530742520,bd[aQ>>2]=-995338651,bd[aX>>2]=-198630844,bd[bJ>>2]=1126891415,bd[b0>>2]=-1416354905,bd[a5>>2]=-57434055,bd[b8>>2]=1700485571,bd[cp>>2]=-1894986606,bd[ci>>2]=-1051523,bd[bf>>2]=-2054922799,bd[bt>>2]=1873313359,bd[aj>>2]=-30611744,bd[cm>>2]=-1560198380,bd[aw>>2]=1309151649,bd[ap>>2]=-145523070,bd[b5>>2]=-1120210379,bd[aD>>2]=718787259,bd[cs>>2]=-343485551,bM=a6,b1=b6,bV=cn,a8=ak,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,a1=74,am=0,aq=1732584193,b2=-271733879,bC=-1732584194,ay=271733878,aY=1732584193,cq=0,ct=0,ad=0,bY=1,a6=bM,b6=b1,cn=bV,ak=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al;continue ba;case 77:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=75,aY=0|bd[a6+(cn<<2)>>2],a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 75:am=0|bd[ch+(ct<<2)>>2],cf=-1&~(1|~(((1^am)&am)-(0-aY))),aE=-1&~(-2|~am),bg=~cf,bT=~aE,cn=268273122,cn=((-268273123&bg|cf&cn)^(-268273123&bT|aE&cn)|~(bg|bT)&(-268273123|cn))-1134317627+((-2^aY)&aY)+1134317627|0,bT=-1&~(1|~(cn+796911875+(-1&~(1|~ak))+-796911875)),bg=(-2^ak)&ak,aE=~bT,cf=~bg,bl=234558881,am=am-(0-aY)|0,aG=a6,au=b6,ab=ak,bN=bY,ag=aM,aS=bh,a0=bZ,bM=az,b1=bK,bV=b3,a8=ad,cb=ct,cr=cq,ck=aY,bi=bC,bw=b2,al=b2,aq=ay,a1=73,am=506753693+((-234558882&aE|bT&bl)^(-234558882&cf|bg&bl)|~(aE|cf)&(-234558882|bl))+((-2^am)&am)-506753693|0,a6=aG,b6=au,ak=ab,bY=bN,aM=ag,bh=aS,bZ=a0,az=bM,bK=b1,b3=bV,ad=a8,ct=cb,cq=cr,aY=ck,ay=bi,bC=bw,b2=al; 4 | continue ba;case 74:bl=a6,b6=cq,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=72,cq=0-(0-cq-1)|0,a6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,aY=cb,ay=cr,bC=ck,b2=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am=al;continue ba;case 68:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=74,ad=0-(0-ad-1)|0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 67:aG=0-(0-(7*((0|ct)%4|0)|0)+(0-bY))|0,cf=am<>>(-117621897-aG+117621929|0),aE=~bl,bg=~cf,aY=-1172163970,aY=(1172163969&aE|bl&aY)^(1172163969&bg|cf&aY)|~(aE|bg)&(1172163969|aY),bg=-1&~(1|~(0-(0-aY+(0-(-1&~(1|~bC)))))),aE=(-2^bC)&bC,cf=~bg,bl=~aE,b2=861084162,au=a6,ab=b6,bN=cn,ag=ak,aS=aM,a0=bh,bM=bZ,b1=az,bV=bK,a8=b3,cb=ad,cr=cq,ck=ay,bi=bC,bw=aq,al=am,a1=97,b2=1763856666+((-861084163&cf|bg&b2)^(-861084163&bl|aE&b2)|~(cf|bl)&(-861084163|b2))+((-2^aY)&aY)-1763856666|0,ct=ct+1402583234+1-1402583234|0,bY=aG,a6=au,b6=ab,cn=bN,ak=ag,aM=aS,bh=a0,bZ=bM,az=b1,bK=bV,b3=a8,ad=cb,cq=cr,ay=ck,bC=bi,aq=bw,am=al;continue ba;case 66:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=64,bh=ad>>2,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 64:aE=a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ct,cr=cq,ck=ay,bi=bC,bw=b2,al=aq,a1=57,am=0-(0-ad+1)>>2,aY=ak,ak=394913534+((-797466866&bl|aE&cn)^(-797466866&aG|cf&cn)|~(bl|aG)&(-797466866|cn))+(-1&~(-2|~ak))-394913534|0,cn=((7*ct|0)%16|0)-(0-cq)|0,a6=au,b6=ab,bY=bN,aM=ag,bh=aS,bZ=a0,az=bM,bK=b1,b3=bV,ad=a8,ct=cb,cq=cr,ay=ck,bC=bi,b2=bw,aq=al;continue ba;case 58:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|ak)<33?56:54,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 57:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)>(ad-817781417+32+817781417>>2|0)?33:55,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 56:cf=a6,bl=b6,aG=cn,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=54,ak=33,a6=cf,b6=bl,cn=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 55:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)>(0|am)?53:47,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al; 5 | continue ba;case 54:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|ak)>(248548091+(ad- -32>>2)+8-248548091|0)?50:52,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 53:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|bh)>0?51:49,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 52:cf=a6,bl=b6,aG=cn,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=50,ak=0-(0-(ad-721543188+32+721543188>>2)-8)|0,a6=cf,b6=bl,cn=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 51:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=23,aY=0|bd[aB+(cn-845217744-am+845217744<<2)>>2],a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 50:bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=46,cq=0,a6=0|cmd5xt(ak<<2,bd,av),b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 49:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=23,aY=0|bd[aB+(cn-1+1839362061-am-1839362061<<2)>>2],a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 161:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,aY=bC,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=157,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,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=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 45:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|bh)>0?43:39,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 158:cf=a6,bl=b6,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=154,cn=cn-1241365298+32+1241365298|0,a6=cf,b6=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 157:bg=-1&~(-29|~(ct<<2)),aE=-419482006,cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=155,aY=-1&~(-16|~(aY>>((419482005&~bg|bg&aE)^(419482001|4&aE)))),a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 43:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=23,aY=0|bd[aB>>2],a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 156:cf=a6,bl=b6,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=154,cn=cn- -72|0,a6=cf,b6=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 42:bd[a6+(cq<<2)>>2]=0,cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=46,cq=cq-1417402377+1+1417402377|0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 155:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|aY)<10?153:151,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al; 6 | continue ba;case 154:cf=ct-(0-bh)|0,bl=cn+-735801710+16+735801710<<(((0|cf)%4|0)<<3),cf=aB+(cf-(0-(cq<<2))>>2<<2)|0,aG=0|bd[cf>>2],bd[cf>>2]=aG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al;continue ba;case 152:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=12,cq=cq+1905239980+1-1905239980|0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 151:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=149,aY=aY+522724937+87-522724937|0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 37:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=23,aY=0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 150:ab=128<<(((0|bh)%4|0)<<3),cf=aB+((cq<<2)-395027463+bh+395027463>>2<<2)|0,bN=0|bd[cf>>2],au=~bN,aG=~ab,bl=-503206211,bd[cf>>2]=(503206210&au|bN&bl)^(503206210&aG|ab&bl)|~(au|aG)&(503206210|bl),cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=146,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r=ay,ck=bC,bi=b2,bw=aq,al=am,a1=145,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 33:a1=ad+1999768042+40+-1999768042>>6<<4,aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)==(14&a1|14^a1|0)?31:29,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 146:aZ=ad- -40>>6<<4,bT=~aZ,bg=-15,a1=-1388890712,aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cq)<((1388890711&bT|aZ&a1)^(1388890711&bg|14&a1)|~(bT|bg)&(1388890711|a1)|0)?143:19,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 32:aG=bj[ba+cq>>0]<<(((0|cq)%4|0)<<3),cf=a6+(cq>>2<<2)|0,bl=0|bd[cf>>2],bd[cf>>2]=aG&bl|aG^bl,cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=36,cq=cq- -1|0,a6=cf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ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=22,cq=ad+(0-bh)|0,a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 139:aG=(bC^~b2)&bC,cn=529461707,cn=(-529461708&~ay|ay&cn)^(-529461708&~b2|b2&cn),cn&=cn^~(0|~b2|0&b2),ak=-1514409255,ak=(1514409254&~cn|cn&ak)^(1514409254&~aG|aG&ak),aG=0-(0-(-1&~(1|~aq))+(0-ak))|0,aG&=1^aG,cn=-1&~(-2|~aq),au=a6,ab=b6,bN=bY,ag=aM,aS=bh,a0=bZ,bM=az,b1=bK,bV=b3,a8=ad,cb=ct,cr=cq,ck=ay,bi=bC,bw=b2,al=aq,a1=138,am=ad-1332493879-1+1332493879>>2,aY=ak,ak=1330564622+(aG&cn|aG^cn)+(-1&~(-2|~ak))-1330564622|0,cn=((0|ct)%16|0)-(0-cq)|0,a6=au,b6=ab,bY=bN,aM=ag,bh=aS,bZ=a0,az=bM,bK=b1,b3=bV,ad=a8,ct=cb,cq=cr,ay=ck,bC=bi,b2=bw,aq=al;continue ba;case 25:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=23,aY=0|bd[a6+(cn<<2)>>2],a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 138:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)>(ad- -32>>2|0)?126:137,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 137:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cn)>(0|am)?136:133,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 23:am=0|bd[ch+(ct<<2)>>2],bY=729837134+(-1&~(1|~am))+aY+-729837134|0,bY&=1^bY,cn=(-2^am)&am,cn=(bY&cn|bY^cn)-1663655995+(-1&~(-2|~aY))+1663655995|0,bY=cn+-2098496209+((1^ak)&ak)+2098496209|0,bY&=1^bY,aG=(-2^ak)&ak,am=(bY&aG|bY^aG)-(0-(-1&~(-2|~(0-(0-am+(0-aY))))))|0,aG=(0|ct)%4|0,aG=(aG<<2)-23571533+601048392+23571533-(0-((0|bm(0-(0-aG+1)|0,aG))/2|0))|0,bY=aG-601048386|0,au=am<>>(0-aG+601048418|0),cf=~au,bl=~aG,bN=1777071146,bN=(-1777071147&cf|au&bN)^(-1777071147&bl|aG&bN)|~(cf|bl)&(-1777071147|bN),bl=(-2^b2)&b2,cf=(-1&~(1|~(b2+-1742022525+1578590490+1742022525)))-702715349+bN+702715349|0,cf&=1^cf,aG=~cf,au=~bl,ab=-1317685326,aZ=(-2^bN)&bN,bT=~aZ,bg=1578590489,aE=-225229395,ag=a6,aS=b6,a0=ak,bM=aM,b1=bh,bV=bZ,a8=az,cb=bK,cr=b3,ck=ad,bi=cq,bw=bC,al=b2,aq=ay,a1=63,b2=0-(0-((225229394&bT|aZ&aE)^(225229394&bg|-1578590490&aE)|~(bT|bg)&(225229394|aE))+(0-((1317685325&aG|cf&ab)^(1317685325&au|bl&ab)|~(aG|au)&(1317685325|ab))))|0,aY=bN,ct=ct+1021816955+1-1021816955|0,a6=ag,b6=aS,ak=a0,aM=bM,bh=b1,bZ=bV,az=a8,bK=cb,b3=cr,ad=ck,cq=bi,ay=bw,bC=al;continue ba;case 136:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|bh)>0?135:134,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 22:aE=a6,cf=b6,bl=cn,aG=ak,au=bY,ab=aM,bN=bh,ag=bZ,aS=az,a0=bK,bM=b3,b1=ad,bV=ct,a8=cq,cb=aY,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=(0|cq)<(0|ad)?18:16,a6=aE,b6=cf,cn=bl,ak=aG,bY=au,aM=ab,bh=bN,bZ=ag,az=aS,bK=a0,b3=bM,ad=b1,ct=bV,cq=a8,aY=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al; 8 | continue ba;case 135:cf=a6,bl=b6,aG=cn,au=ak,ab=bY,bN=aM,ag=bh,aS=bZ,a0=az,bM=bK,b1=b3,bV=ad,a8=ct,cb=cq,cr=ay,ck=bC,bi=b2,bw=aq,al=am,a1=121,aY=0|bd[aB+(cn+(0-am)<<2)>>2],a6=cf,b6=bl,cn=aG,ak=au,bY=ab,aM=bN,bh=ag,bZ=aS,az=a0,bK=bM,b3=b1,ad=bV,ct=a8,cq=cb,ay=cr,bC=ck,b2=bi,aq=bw,am=al;continue ba;case 21:ar=(-2^b3)&b3,bE=aq- -33242356+252947873+((1^b3)&b3)-252947873|0,bE&=1^bE,ax=~bE,co=~ar,aZ=380726746,cg=-1&~(-2|~aq),aa=~cg,aF=33242355,b7=306070461,cf=((1^az)&az)-1609523247+bC+1609523247|0,cf&=1^cf,bl=-1&~(-2|~az),aG=-1&~(1|~(((1^bZ)&bZ)-1778799498+ay+1778799498)),au=(-2^bZ)&bZ,bg=b2- -924935704-2103109303+((1^bK)&bK)+2103109303|0,bg&=1^bg,aE=(-2^bK)&bK,bT=(-2^b2)&b2,ab=a6,bN=b6,ag=cn,aS=ak,a0=bY,bM=aM,b1=bh,bV=bZ,a8=az,cb=bK,cr=b3,ck=ad,bi=ct,bw=aY,al=am,a1=146,aq=((-306070462&aa|cg&b7)^(-306070462&aF|-33242356&b7)|~(aa|aF)&(-306070462|b7))-(0-((-380726747&ax|bE&aZ)^(-380726747&co|ar&aZ)|~(ax|co)&(-380726747|aZ)))|0,b2=(-924935704&bT|-924935704^bT)-937268693+(bg&aE|bg^aE)+937268693|0,bC=0-(0-(cf&bl|cf^bl)+(0-(-1&~(-2|~bC))))|0,ay=(aG&au|aG^au)-(0-((-2^ay)&ay))|0,cq=0-(0-cq-16)|0,a6=ab,b6=bN,cn=ag,ak=aS,bY=a0,aM=bM,bh=b1,bZ=bV,az=a8,bK=cb,b3=cr,ad=ck,ct=bi,aY=bw,am=al;continue ba;case 134:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=cq,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=121,aY=0|bd[aB+(cn-2095981013-1+2095981013-1028988577-am+1028988577<<2)>>2],a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,cq=ar,ay=bE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a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 125:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=cq,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=121,aY=961017688+(ad<<3)+256-961017688|0,a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,cq=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg; 9 | continue ba;case 11:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=9,cq=(0|ct)/8|0,a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 124:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=(0|cn)>(am+-1509393712+1+1509393712|0)?123:122,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 123:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=cq,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=121,aY=0,a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,cq=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 9:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=0==(0|cq)?7:5,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 122:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=cq,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=121,aY=0|bd[a6+(cn<<2)>>2],a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,cq=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 8:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=4,ct=0,a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 121:cn=0|bd[ch+(ct<<2)>>2],am=-1&~(-2|~cn),cn=-1&~(1|~(0-(0-(0-(0-aY+96809952))+(0-(-1&~(1|~cn)))))),bY=(-2^aY)&aY,bV=~bY,cr=524507311,a8=205119056,am=0-(0-((-205119057&bV|bY&a8)^(-205119057&cr|-524507312&a8)|~(bV|cr)&(-205119057|a8))+(0-(cn&am|cn^am)))|0,cn=0-(0-am-621317264)|0,a8=(-2^ak)&ak,cr=-1&~(1|~(cn-(0-((1^ak)&ak)))),bV=~cr,bY=~a8,cb=1186168602,am=-1&~(-2|~(1196940885-am-1818258150)),am=((-1186168603&bV|cr&cb)^(-1186168603&bY|a8&cb)|~(bV|bY)&(-1186168603|cb))-1517567764+(1&~am|-2&am)+1517567764|0,cb=5*((0|ct)%4|0)|0,bY=cb- -7|0,bV=am<>>(0-cb+25|0),cb=bV&cb|bV^cb,bV=-1&~(1|~(cb+1491303093+((1^b2)&b2)+-1491303093)),a8=(-2^b2)&b2,cr=a6,ck=b6,bi=ak,bw=aM,al=bh,co=bZ,ax=az,ar=bK,bE=b3,b7=ad,aF=cq,aa=bC,cg=b2,aq=ay,a1=141,b2=(bV&a8|bV^a8)-(0-((-2^cb)&cb))|0,aY=cb,ct=ct- -1|0,a6=cr,b6=ck,ak=bi,aM=bw,bh=al,bZ=co,az=ax,bK=ar,b3=bE,ad=b7,cq=aF,ay=aa,bC=cg;continue ba;case 7:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=cq,aY=aq,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=157,a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,cq=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 119:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=(0|ct)<32?117:97,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 5:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=1==(0|cq)?3:1,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 4:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=(0|ct)<4?0:152,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 117:ak=0|~ay|0&ay,aS=223327204&~b2|-223327205&b2,b1=~aS,cn=~ak,bM=381686884,bM=(-381686885&b1|aS&bM)^(-381686885&cn|ak&bM)|~(b1|cn)&(-381686885|bM),cn=-2088055562,cn=(2088055561&~bC|bC&cn)^(1882193929|223327204&cn),b1=~ay,aS=~cn,a0=1424487793,a0=(-1424487794&b1|ay&a0)^(-1424487794&aS|cn&a0)|~(b1|aS)&(-1424487794|a0),bM&=-223327205^bM,aS=-1&~(223327204|~b2),aS&=aS^~ay,a0&=-223327205^a0,ak&=223327204^ak,ak&=ak^~(bC&~ay|ay&~bC),aS=bM&aS|bM^aS,a0=ak&a0|ak^a0,ak=-539859516,ak=(539859515&~a0|a0&ak)^(539859515&~aS|aS&ak),aS=-1&~(1|~((-1&~(1|~aq))-(0-ak))),a0=(-2^aq)&aq,bM=~aS,b1=~a0,cn=89952540,bV=a6,a8=b6,cb=bY,cr=aM,ck=bh,bi=bZ,bw=az,al=bK,co=b3,ax=ad,ar=ct,bE=cq,b7=ay,aF=bC,aa=b2,cg=aq,a1=116,am=0-(0-ad+1)>>2,aY=ak,ak=1116549971+((-89952541&bM|aS&cn)^(-89952541&b1|a0&cn)|~(bM|b1)&(-89952541|cn))+(-1&~(-2|~ak))-1116549971|0,cn=0-(0-((106029065+(5*ct|0)+1-106029065|0)%16|0)+(0-cq))|0,a6=bV,b6=a8,bY=cb,aM=cr,bh=ck,bZ=bi,az=bw,bK=al,b3=co,ad=ax,ct=ar,cq=bE,ay=b7,bC=aF,b2=aa,aq=cg;continue ba;case 3:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=cq,aY=b2,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=157,a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,cq=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 116:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=(0|cn)>(ad+77471208+32-77471208>>2|0)?104:115,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg; 10 | continue ba;case 115:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=(0|cn)>(0|am)?114:111,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 1:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=2==(0|cq)?161:159,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 114:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=(0|bh)>0?113:112,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 0:a0=a6,bM=b6,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=160,cn=(426025673+(5*((27*cq|0)-(0-(62*ct|0))-(0-(0|bm(0-(0-(84*cq|0)-21)|0,1910606658+(28*ct|0)+97-1910606658|0)))|0)|0)+615-426025673|0)%32|0,a6=a0,b6=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;case 113:a0=a6,bM=b6,b1=cn,bV=ak,a8=bY,cb=aM,cr=bh,ck=bZ,bi=az,bw=bK,al=b3,co=ad,ax=ct,ar=cq,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a1=99,aY=0|bd[aB+(cn+1501901147-am-1501901147<<2)>>2],a6=a0,b6=bM,cn=b1,ak=bV,bY=a8,aM=cb,bh=cr,bZ=ck,az=bi,bK=bw,b3=al,ad=co,ct=ax,cq=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba;default:aS=a6,a0=b6,bM=cn,b1=ak,bV=bY,a8=aM,cb=bh,cr=bZ,ck=az,bi=bK,bw=b3,al=ad,co=ct,ax=cq,ar=aY,bE=ay,b7=bC,aF=b2,aa=aq,cg=am,a6=aS,b6=a0,cn=bM,ak=b1,bY=bV,aM=a8,bh=cb,bZ=cr,az=ck,bK=bi,b3=bw,ad=al,ct=co,cq=ax,aY=ar,ay=bE,bC=b7,b2=aF,aq=aa,am=cg;continue ba}}if(136==(0|an)){a3=b9;for(var aC=0,cl=0;;){var ao=ah[aM+cl>>0];if(aC|=ao,0==ao){break}cl++}var at="";if(aC<128){for(var b4;cl>0;){b4=String.fromCharCode.apply(String,ah.subarray(aM,aM+Math.min(cl,1024))),at=at?at+b4:b4,aM+=1024,cl-=1024}return at}}return a3=b9,0}function cmd5xt(au,aw,ap){au|=0;var ak=0,ay=0,ae=0,aj=0,af=0,ag=0,at=0,ad=0,ax=0,an=0,am=0,av=0,ab=0,aq=0,al=0,ac=0,aa=0,Y=0,ai=0,W=0,ah=0,K=0,ar=0,T=0,ao=0,Q=0,L=0,J=0,G=0,az=0,V=0,N=0,P=0,H=0,X=0,O=0;do{if(au>>>0<245){if(ab=au>>>0<11?16:au+11&-8,au=ab>>>3,ad=0|aw[48],3&(ak=ad>>>au)|0){ak=(1&ak^1)+au|0,ay=232+(ak<<1<<2)|0,ae=ay+8|0,aj=0|aw[ae>>2],af=aj+8|0,ag=0|aw[af>>2];do{if((0|ay)!=(0|ag)){if(au=ag+12|0,(0|aw[au>>2])==(0|aj)){aw[au>>2]=ay,aw[ae>>2]=ag;break}}else{aw[48]=ad&~(1<>2]=3|O,O=aj+O+4|0,aw[O>>2]=1|aw[O>>2],0|(O=af)}if(ag=0|aw[50],ab>>>0>ag>>>0){if(0|ak){ay=2<>>12&16,ay>>>=at,aj=ay>>>5&8,ay>>>=aj,af=ay>>>2&4,ay>>>=af,ae=ay>>>1&2,ay>>>=ae,ak=ay>>>1&1,ak=(aj|at|af|ae|ak)+(ay>>>ak)|0,ay=232+(ak<<1<<2)|0,ae=ay+8|0,af=0|aw[ae>>2],at=af+8|0,aj=0|aw[at>>2];do{if((0|ay)!=(0|aj)){if(au=aj+12|0,(0|aw[au>>2])==(0|af)){aw[au>>2]=ay,aw[ae>>2]=aj,ax=0|aw[50];break}}else{aw[48]=ad&~(1<>2]=3|ab,ae=af+ab|0,aw[ae+4>>2]=1|ag,aw[ae+ag>>2]=ag,0|ax&&(aj=0|aw[53],ak=ax>>>3,ay=232+(ak<<1<<2)|0,au=0|aw[48],ak=1<>2])>>>0<(0|aw[52])>>>0||(an=au,am=ak)):(aw[48]=au|ak,an=ay+8|0,am=ay),aw[an>>2]=aj,aw[am+12>>2]=aj,aw[aj+8>>2]=am,aw[aj+12>>2]=ay),aw[50]=ag,aw[53]=ae,0|(O=at)}if(au=0|aw[49]){for(ay=(au&0-au)-1|0,X=ay>>>12&16,ay>>>=X,H=ay>>>5&8,ay>>>=H,O=ay>>>2&4,ay>>>=O,ak=ay>>>1&2,ay>>>=ak,ae=ay>>>1&1,ae=0|aw[496+((H|X|O|ak|ae)+(ay>>>ae)<<2)>>2],ay=(-8&aw[ae+4>>2])-ab|0,ak=ae;;){if(!(au=0|aw[ak+16>>2])&&!(au=0|aw[ak+20>>2])){ad=ae;break}ak=(-8&aw[au+4>>2])-ab|0,O=ak>>>0>>0,ay=O?ak:ay,ak=au,ae=O?au:ae}af=0|aw[52],at=ad+ab|0,ag=0|aw[ad+24>>2],ae=0|aw[ad+12>>2];do{if((0|ae)==(0|ad)){if(ak=ad+20|0,!((au=0|aw[ak>>2])||(ak=ad+16|0,au=0|aw[ak>>2]))){av=0;break}for(;;){if(ae=au+20|0,0|(aj=0|aw[ae>>2])){au=aj,ak=ae}else{if(ae=au+16|0,!(aj=0|aw[ae>>2])){break}au=aj,ak=ae}}if(!(ak>>>0>>0)){aw[ak>>2]=0,av=au;break}}else{if(aj=0|aw[ad+8>>2],au=aj+12|0,ak=ae+8|0,(0|aw[ak>>2])==(0|ad)){aw[au>>2]=ae,aw[ak>>2]=aj,av=ae;break}}}while(0);do{if(0|ag){if(au=0|aw[ad+28>>2],ak=496+(au<<2)|0,(0|ad)==(0|aw[ak>>2])){if(aw[ak>>2]=av,!av){aw[49]=aw[49]&~(1<>2])==(0|ad)?aw[au>>2]=av:aw[ag+20>>2]=av,!av){break}}ak=0|aw[52],aw[av+24>>2]=ag,au=0|aw[ad+16>>2];do{if(0|au&&!(au>>>0>>0)){aw[av+16>>2]=au,aw[au+24>>2]=av;break}}while(0);if(0|(au=0|aw[ad+20>>2])&&!(au>>>0<(0|aw[52])>>>0)){aw[av+20>>2]=au,aw[au+24>>2]=av;break}}}while(0);return ay>>>0<16?(O=ay+ab|0,aw[ad+4>>2]=3|O,O=ad+O+4|0,aw[O>>2]=1|aw[O>>2]):(aw[ad+4>>2]=3|ab,aw[at+4>>2]=1|ay,aw[at+ay>>2]=ay,au=0|aw[50],0|au&&(aj=0|aw[53],ak=au>>>3,ae=232+(ak<<1<<2)|0,au=0|aw[48],ak=1<>2])>>>0<(0|aw[52])>>>0||(aq=au,al=ak)):(aw[48]=au|ak,aq=ae+8|0,al=ae),aw[aq>>2]=aj,aw[al+12>>2]=aj,aw[aj+8>>2]=al,aw[aj+12>>2]=ae),aw[50]=ay,aw[53]=at),0|(O=ad+8|0) 11 | }}}else{if(au>>>0<=4294967231){if(au=au+11|0,ab=-8&au,ad=0|aw[49]){ay=0-ab|0,au>>>=8,au?ab>>>0>16777215?at=31:(al=(au+1048320|0)>>>16&8,G=au<>>16&4,G<<=aq,at=(G+245760|0)>>>16&2,at=14-(aq|al|at)+(G<>>15)|0,at=ab>>>(at+7|0)&1|at<<1):at=0,ak=0|aw[496+(at<<2)>>2];au:do{if(ak){for(aj=ay,au=0,af=ab<<(31==(0|at)?0:25-(at>>>1)|0),ag=ak,ak=0;;){if(ae=-8&aw[ag+4>>2],(ay=ae-ab|0)>>>0>>0){if((0|ae)==(0|ab)){au=ag,ak=ag,G=90;break au}ak=ag}else{ay=aj}if(ae=0|aw[ag+20>>2],ag=0|aw[ag+16+(af>>>31<<2)>>2],au=0==(0|ae)|(0|ae)==(0|ag)?au:ae,ae=0==(0|ag)){G=86;break}aj=ay,af<<=1&ae^1}}else{au=0,ak=0,G=86}}while(0);if(86==(0|G)){if(0==(0|au)&0==(0|ak)){if(au=2<>>12&16,al>>>=am,an=al>>>5&8,al>>>=an,av=al>>>2&4,al>>>=av,aq=al>>>1&2,al>>>=aq,au=al>>>1&1,au=0|aw[496+((an|am|av|aq|au)+(al>>>au)<<2)>>2]}au?G=90:(at=ay,ad=ak)}if(90==(0|G)){for(;;){if(G=0,al=(-8&aw[au+4>>2])-ab|0,ae=al>>>0>>0,ay=ae?al:ay,ak=ae?au:ak,0|(ae=0|aw[au+16>>2])){au=ae,G=90}else{if(!(au=0|aw[au+20>>2])){at=ay,ad=ak;break}G=90}}}if(0!=(0|ad)?at>>>0<((0|aw[50])-ab|0)>>>0:0){aj=0|aw[52],ag=ad+ab|0,af=0|aw[ad+24>>2],ay=0|aw[ad+12>>2];do{if((0|ay)==(0|ad)){if(ak=ad+20|0,!((au=0|aw[ak>>2])||(ak=ad+16|0,au=0|aw[ak>>2]))){aa=0;break}for(;;){if(ay=au+20|0,0|(ae=0|aw[ay>>2])){au=ae,ak=ay}else{if(ay=au+16|0,!(ae=0|aw[ay>>2])){break}au=ae,ak=ay}}if(!(ak>>>0>>0)){aw[ak>>2]=0,aa=au;break}}else{if(ae=0|aw[ad+8>>2],au=ae+12|0,ak=ay+8|0,(0|aw[ak>>2])==(0|ad)){aw[au>>2]=ay,aw[ak>>2]=ae,aa=ay;break}}}while(0);do{if(0|af){if(au=0|aw[ad+28>>2],ak=496+(au<<2)|0,(0|ad)==(0|aw[ak>>2])){if(aw[ak>>2]=aa,!aa){aw[49]=aw[49]&~(1<>2])==(0|ad)?aw[au>>2]=aa:aw[af+20>>2]=aa,!aa){break}}ak=0|aw[52],aw[aa+24>>2]=af,au=0|aw[ad+16>>2];do{if(0|au&&!(au>>>0>>0)){aw[aa+16>>2]=au,aw[au+24>>2]=aa;break}}while(0);if(0|(au=0|aw[ad+20>>2])&&!(au>>>0<(0|aw[52])>>>0)){aw[aa+20>>2]=au,aw[au+24>>2]=aa;break}}}while(0);do{if(at>>>0>=16){if(aw[ad+4>>2]=3|ab,aw[ag+4>>2]=1|at,aw[ag+at>>2]=at,au=at>>>3,at>>>0<256){ay=232+(au<<1<<2)|0,ak=0|aw[48],au=1<>2])>>>0<(0|aw[52])>>>0||(ai=au,W=ak)):(aw[48]=ak|au,ai=ay+8|0,W=ay),aw[ai>>2]=ag,aw[W+12>>2]=ag,aw[ag+8>>2]=W,aw[ag+12>>2]=ay;break}if(au=at>>>8,au?at>>>0>16777215?ay=31:(X=(au+1048320|0)>>>16&8,O=au<>>16&4,O<<=H,ay=(O+245760|0)>>>16&2,ay=14-(H|X|ay)+(O<>>15)|0,ay=at>>>(ay+7|0)&1|ay<<1):ay=0,ae=496+(ay<<2)|0,aw[ag+28>>2]=ay,au=ag+16|0,aw[au+4>>2]=0,aw[au>>2]=0,au=0|aw[49],ak=1<>2]=ag,aw[ag+24>>2]=ae,aw[ag+12>>2]=ag,aw[ag+8>>2]=ag;break}for(aj=at<<(31==(0|ay)?0:25-(ay>>>1)|0),au=0|aw[ae>>2];;){if((-8&aw[au+4>>2]|0)==(0|at)){ay=au,G=148;break}if(ak=au+16+(aj>>>31<<2)|0,!(ay=0|aw[ak>>2])){G=145;break}aj<<=1,au=ay}if(145==(0|G)){if(!(ak>>>0<(0|aw[52])>>>0)){aw[ak>>2]=ag,aw[ag+24>>2]=au,aw[ag+12>>2]=ag,aw[ag+8>>2]=ag;break}if(148==(0|G)&&(au=ay+8|0,ak=0|aw[au>>2],O=0|aw[52],ak>>>0>=O>>>0&ay>>>0>=O>>>0)){aw[ak+12>>2]=ag,aw[au>>2]=ag,aw[ag+8>>2]=ak,aw[ag+12>>2]=ay,aw[ag+24>>2]=0;break}}}else{O=at+ab|0,aw[ad+4>>2]=3|O,O=ad+O+4|0,aw[O>>2]=1|aw[O>>2]}}while(0);return 0|(O=ad+8|0)}}}else{ab=-1}}}while(0);if((ay=0|aw[50])>>>0>=ab>>>0){return au=ay-ab|0,ak=0|aw[53],au>>>0>15?(O=ak+ab|0,aw[53]=O,aw[50]=au,aw[O+4>>2]=1|au,aw[O+au>>2]=au,aw[ak+4>>2]=3|ab):(aw[50]=0,aw[53]=0,aw[ak+4>>2]=3|ay,O=ak+ay+4|0,aw[O>>2]=1|aw[O>>2]),0|(O=ak+8|0)}if((au=0|aw[51])>>>0>ab>>>0){return H=au-ab|0,aw[51]=H,O=0|aw[54],X=O+ab|0,aw[54]=X,aw[X+4>>2]=1|H,aw[O+4>>2]=3|ab,0|(O=O+8|0)}do{if(!(0|aw[166]||(au=4096)+-1&au)){aw[168]=au,aw[167]=au,aw[169]=-1,aw[170]=-1,aw[171]=0,aw[159]=0,aw[166]=Date.now()/1000&-16^1431655768;break}}while(0);if(ag=ab+48|0,af=0|aw[168],at=ab+47|0,aj=af+at|0,af=0-af|0,(ad=aj&af)>>>0<=ab>>>0){return 0|(O=0)}if(au=0|aw[158],0|au?(ai=0|aw[156],(W=ai+ad|0)>>>0<=ai>>>0|W>>>0>au>>>0):0){return 0|(O=0)}au:do{if(4&aw[159]){G=190}else{au=0|aw[54];aw:do{if(au){for(ay=640;;){if(ak=0|aw[ay>>2],ak>>>0<=au>>>0?(ac=ay+4|0,(ak+(0|aw[ac>>2])|0)>>>0>au>>>0):0){ae=ay,ay=ac;break}if(!(ay=0|aw[ay+8>>2])){G=173;break aw}}if((au=aj-(0|aw[51])&af)>>>0<2147483647){if((0|(ak=ap))==((0|aw[ae>>2])+(0|aw[ay>>2])|0)){if(-1!=(0|ak)){ag=ak,aj=au,G=193;break au}}else{G=183}}}else{G=173}}while(0);do{if((173==(0|G)?-1!=(0|(Y=ap)):0)&&(au=Y,ak=0|aw[167],ay=ak+-1|0,au=ay&au?ad-au+(ay+au&0-ak)|0:ad,ak=0|aw[156],ay=ak+au|0,au>>>0>ab>>>0&au>>>0<2147483647)){if(W=0|aw[158],0|W?ay>>>0<=ak>>>0|ay>>>0>W>>>0:0){break}if((0|(ak=ap))==(0|Y)){ag=Y,aj=au,G=193;break au}G=183}}while(0);aw:do{if(183==(0|G)){ay=0-au|0;do{if(ag>>>0>au>>>0&au>>>0<2147483647&-1!=(0|ak)?(ah=0|aw[168],(ah=at-au+ah&0-ah)>>>0<2147483647):0){if(-1==ap){break aw}au=ah+au|0;break}}while(0);if(-1!=(0|ak)){ag=ak,aj=au,G=193;break au}}}while(0);aw[159]=4|aw[159],G=190}}while(0);if((((190==(0|G)?ad>>>0<2147483647:0)?(K=ap,ar=ap,K>>>0>>0&-1!=(0|K)&-1!=(0|ar)):0)?(T=ar-K|0)>>>0>(ab+40|0)>>>0:0)&&(ag=K,aj=T,G=193),193==(0|G)){au=(0|aw[156])+aj|0,aw[156]=au,au>>>0>(0|aw[157])>>>0&&(aw[157]=au),at=0|aw[54]; 12 | do{if(at){ae=640;do{if(au=0|aw[ae>>2],ak=ae+4|0,ay=0|aw[ak>>2],(0|ag)==(au+ay|0)){ao=au,Q=ak,L=ay,J=ae,G=203;break}ae=0|aw[ae+8>>2]}while(0!=(0|ae));if((203==(0|G)?0==(8&aw[J+12>>2]|0):0)?at>>>0>>0&at>>>0>=ao>>>0:0){aw[Q>>2]=L+aj,O=at+8|0,O=0==(7&O|0)?0:0-O&7,X=at+O|0,O=aj-O+(0|aw[51])|0,aw[54]=X,aw[51]=O,aw[X+4>>2]=1|O,aw[X+O+4>>2]=40,aw[55]=aw[170];break}for(au=0|aw[52],ag>>>0>>0?(aw[52]=ag,ad=ag):ad=au,ay=ag+aj|0,au=640;;){if((0|aw[au>>2])==(0|ay)){ak=au,G=211;break}if(!(au=0|aw[au+8>>2])){ak=640;break}}if(211==(0|G)){if(!(8&aw[au+12>>2])){aw[ak>>2]=ag,an=au+4|0,aw[an>>2]=(0|aw[an>>2])+aj,an=ag+8|0,an=ag+(0==(7&an|0)?0:0-an&7)|0,au=ay+8|0,au=ay+(0==(7&au|0)?0:0-au&7)|0,ax=an+ab|0,af=au-an-ab|0,aw[an+4>>2]=3|ab;do{if((0|au)!=(0|at)){if((0|au)==(0|aw[53])){O=(0|aw[50])+af|0,aw[50]=O,aw[53]=ax,aw[ax+4>>2]=1|O,aw[ax+O>>2]=O;break}if(1==(3&(ak=0|aw[au+4>>2])|0)){at=-8&ak,aj=ak>>>3;au:do{if(ak>>>0>=256){ag=0|aw[au+24>>2],ae=0|aw[au+12>>2];do{if((0|ae)==(0|au)){if(ay=au+16|0,ae=ay+4|0,ak=0|aw[ae>>2]){ay=ae}else{if(!(ak=0|aw[ay>>2])){H=0;break}}for(;;){if(ae=ak+20|0,0|(aj=0|aw[ae>>2])){ak=aj,ay=ae}else{if(ae=ak+16|0,!(aj=0|aw[ae>>2])){break}ak=aj,ay=ae}}if(!(ay>>>0>>0)){aw[ay>>2]=0,H=ak;break}}else{if(aj=0|aw[au+8>>2],ak=aj+12|0,ay=ae+8|0,(0|aw[ay>>2])==(0|au)){aw[ak>>2]=ae,aw[ay>>2]=aj,H=ae;break}}}while(0);if(!ag){break}ak=0|aw[au+28>>2],ay=496+(ak<<2)|0;do{if((0|au)==(0|aw[ay>>2])){if(aw[ay>>2]=H,0|H){break}aw[49]=aw[49]&~(1<>2])==(0|au)?aw[ak>>2]=H:aw[ag+20>>2]=H,!H){break au}}while(0);ae=0|aw[52],aw[H+24>>2]=ag,ak=au+16|0,ay=0|aw[ak>>2];do{if(0|ay&&!(ay>>>0>>0)){aw[H+16>>2]=ay,aw[ay+24>>2]=H;break}}while(0);if(!(ak=0|aw[ak+4>>2])){break}if(!(ak>>>0<(0|aw[52])>>>0)){aw[H+20>>2]=ak,aw[ak+24>>2]=H;break}}else{ay=0|aw[au+8>>2],ae=0|aw[au+12>>2],ak=232+(aj<<1<<2)|0;do{if((0|ay)!=(0|ak)&&(0|aw[ay+12>>2])==(0|au)){break}}while(0);if((0|ae)==(0|ay)){aw[48]=aw[48]&~(1<>2])==(0|au)){V=ak;break}}}while(0);aw[ay+12>>2]=ae,aw[V>>2]=ay}}while(0);au=au+at|0,af=at+af|0}if(au=au+4|0,aw[au>>2]=-2&aw[au>>2],aw[ax+4>>2]=1|af,aw[ax+af>>2]=af,au=af>>>3,af>>>0<256){ay=232+(au<<1<<2)|0,ak=0|aw[48],au=1<>2])>>>0>=(0|aw[52])>>>0){X=au,O=ak;break}}else{aw[48]=ak|au,X=ay+8|0,O=ay}}while(0);aw[X>>2]=ax,aw[O+12>>2]=ax,aw[ax+8>>2]=O,aw[ax+12>>2]=ay;break}au=af>>>8;do{if(au){if(af>>>0>16777215){ay=31;break}X=(au+1048320|0)>>>16&8,O=au<>>16&4,O<<=H,ay=(O+245760|0)>>>16&2,ay=14-(H|X|ay)+(O<>>15)|0,ay=af>>>(ay+7|0)&1|ay<<1}else{ay=0}}while(0);if(ae=496+(ay<<2)|0,aw[ax+28>>2]=ay,au=ax+16|0,aw[au+4>>2]=0,aw[au>>2]=0,au=0|aw[49],ak=1<>2]=ax,aw[ax+24>>2]=ae,aw[ax+12>>2]=ax,aw[ax+8>>2]=ax;break}for(aj=af<<(31==(0|ay)?0:25-(ay>>>1)|0),au=0|aw[ae>>2];;){if((-8&aw[au+4>>2]|0)==(0|af)){ay=au,G=281;break}if(ak=au+16+(aj>>>31<<2)|0,!(ay=0|aw[ak>>2])){G=278;break}aj<<=1,au=ay}if(278==(0|G)){if(!(ak>>>0<(0|aw[52])>>>0)){aw[ak>>2]=ax,aw[ax+24>>2]=au,aw[ax+12>>2]=ax,aw[ax+8>>2]=ax;break}if(281==(0|G)&&(au=ay+8|0,ak=0|aw[au>>2],O=0|aw[52],ak>>>0>=O>>>0&ay>>>0>=O>>>0)){aw[ak+12>>2]=ax,aw[au>>2]=ax,aw[ax+8>>2]=ak,aw[ax+12>>2]=ay,aw[ax+24>>2]=0;break}}}else{O=(0|aw[51])+af|0,aw[51]=O,aw[54]=ax,aw[ax+4>>2]=1|O}}while(0);return 0|(O=an+8|0)}ak=640}for(;;){if(au=0|aw[ak>>2],au>>>0<=at>>>0?(az=au+(0|aw[ak+4>>2])|0)>>>0>at>>>0:0){ak=az;break}ak=0|aw[ak+8>>2]}af=ak+-47|0,ay=af+8|0,ay=af+(0==(7&ay|0)?0:0-ay&7)|0,af=at+16|0,ay=ay>>>0>>0?at:ay,au=ay+8|0,ae=ag+8|0,ae=0==(7&ae|0)?0:0-ae&7,O=ag+ae|0,ae=aj+-40-ae|0,aw[54]=O,aw[51]=ae,aw[O+4>>2]=1|ae,aw[O+ae+4>>2]=40,aw[55]=aw[170],ae=ay+4|0,aw[ae>>2]=27,aw[au>>2]=aw[160],aw[au+4>>2]=aw[161],aw[au+8>>2]=aw[162],aw[au+12>>2]=aw[163],aw[160]=ag,aw[161]=aj,aw[163]=0,aw[162]=au,au=ay+24|0;do{au=au+4|0,aw[au>>2]=7}while((au+4|0)>>>0>>0);if((0|ay)!=(0|at)){if(ag=ay-at|0,aw[ae>>2]=-2&aw[ae>>2],aw[at+4>>2]=1|ag,aw[ay>>2]=ag,au=ag>>>3,ag>>>0<256){ay=232+(au<<1<<2)|0,ak=0|aw[48],au=1<>2])>>>0<(0|aw[52])>>>0||(N=au,P=ak)):(aw[48]=ak|au,N=ay+8|0,P=ay),aw[N>>2]=at,aw[P+12>>2]=at,aw[at+8>>2]=P,aw[at+12>>2]=ay;break}if(au=ag>>>8,au?ag>>>0>16777215?ay=31:(X=(au+1048320|0)>>>16&8,O=au<>>16&4,O<<=H,ay=(O+245760|0)>>>16&2,ay=14-(H|X|ay)+(O<>>15)|0,ay=ag>>>(ay+7|0)&1|ay<<1):ay=0,aj=496+(ay<<2)|0,aw[at+28>>2]=ay,aw[at+20>>2]=0,aw[af>>2]=0,au=0|aw[49],ak=1<>2]=at,aw[at+24>>2]=aj,aw[at+12>>2]=at,aw[at+8>>2]=at;break}for(ae=ag<<(31==(0|ay)?0:25-(ay>>>1)|0),au=0|aw[aj>>2];;){if((-8&aw[au+4>>2]|0)==(0|ag)){ay=au,G=307;break}if(ak=au+16+(ae>>>31<<2)|0,!(ay=0|aw[ak>>2])){G=304;break}ae<<=1,au=ay}if(304==(0|G)){if(!(ak>>>0<(0|aw[52])>>>0)){aw[ak>>2]=at,aw[at+24>>2]=au,aw[at+12>>2]=at,aw[at+8>>2]=at;break}if(307==(0|G)&&(au=ay+8|0,ak=0|aw[au>>2],O=0|aw[52],ak>>>0>=O>>>0&ay>>>0>=O>>>0)){aw[ak+12>>2]=at,aw[au>>2]=at,aw[at+8>>2]=ak,aw[at+12>>2]=ay,aw[at+24>>2]=0; 13 | break}}}}else{O=0|aw[52],0==(0|O)|ag>>>0>>0&&(aw[52]=ag),aw[160]=ag,aw[161]=aj,aw[163]=0,aw[57]=aw[166],aw[56]=-1,au=0;do{O=232+(au<<1<<2)|0,aw[O+12>>2]=O,aw[O+8>>2]=O,au=au+1|0}while(32!=(0|au));O=ag+8|0,O=0==(7&O|0)?0:0-O&7,X=ag+O|0,O=aj+-40-O|0,aw[54]=X,aw[51]=O,aw[X+4>>2]=1|O,aw[X+O+4>>2]=40,aw[55]=aw[170]}}while(0);if((au=0|aw[51])>>>0>ab>>>0){return H=au-ab|0,aw[51]=H,O=0|aw[54],X=O+ab|0,aw[54]=X,aw[X+4>>2]=1|H,aw[O+4>>2]=3|ab,0|(O=O+8|0)}}return 0}; -------------------------------------------------------------------------------- /scripts/lives/iqiyi.py: -------------------------------------------------------------------------------- 1 | # 获取爱奇艺直播的真实流媒体地址。 2 | # iqiyi.js是cmd5x加密函数 3 | 4 | import json 5 | import re 6 | import time 7 | import urllib.parse 8 | 9 | import execjs 10 | import requests 11 | 12 | from scripts.base import Base 13 | 14 | 15 | class IQiYi(Base): 16 | """获取爱奇艺 m3u8 格式直播源 17 | 18 | 输入房间号,通常是数字,比如链接 https://gamelive.iqiyi.com/w/74429 中的 74429。 19 | 注意: 20 | 爱奇艺有部分直播是来自pps的,要打开房间看链接是否有跳转,有则用pps.py 21 | 爱奇艺直播依赖js环境,建议安装node.js。 22 | 23 | Attributes: 24 | rid: 房间号 25 | """ 26 | _name = '爱奇艺' 27 | 28 | def __init__(self, rid): 29 | super(Base, self).__init__() 30 | self.rid = rid 31 | self.s = requests.Session() 32 | 33 | def get_real_url(self): 34 | """ 35 | 里面iqiyi.js是个加盐的md5,execjs执行后获取cmd5x的返回值 36 | 37 | Returns: 38 | m3u8格式播放地址 39 | 40 | Raises: 41 | incorrect rid: 请确实是爱奇艺直播房间号:爱奇艺有部分直播是来自pps的,要打开房间看链接是否有跳转,有则用pps.py 42 | Could not find an available JavaScript runtime: 是否安装了js环境 43 | 44 | """ 45 | 46 | res = self.s.get('https://m-gamelive.iqiyi.com/w/' + self.rid).text 47 | # 获取直播间的qipuId 48 | try: 49 | qipuid, = re.findall(r'"qipuId":(\d*?),"roomId', res) 50 | except ValueError: 51 | return 'Incorrect rid.' 52 | 53 | callback = 'jsonp_' + str(int((time.time() * 1000))) + '_0000' 54 | params = { 55 | 'lp': qipuid, 56 | 'src': '01010031010000000000', 57 | 'rateVers': 'H5_QIYI', 58 | 'qd_v': 1, 59 | 'callback': callback 60 | } 61 | # ba传参iqiyi.js,返回vf 62 | ba = '/jp/live?' + urllib.parse.urlencode(params) 63 | with open('scripts/lives/iqiyi.js', 'r') as f: 64 | content = f.read() 65 | try: 66 | cmd5x = execjs.compile(content) 67 | vf = cmd5x.call('cmd5x', ba) 68 | except RuntimeError: 69 | return 'Could not find an available JavaScript runtime.' 70 | # 请求 71 | response = self.s.get('https://live.video.iqiyi.com' + ba, params={'vf': vf}).text 72 | print(response) 73 | url_json = json.loads(re.findall(r'try{.*?\((.*)\);}catch\(e\){};', response)[0]) 74 | try: 75 | url = (url_json.get('data').get('streams'))[0].get('url') 76 | except: 77 | return 'server return err-data.' 78 | url = url.replace('hlslive.video.iqiyi.com', 'm3u8live.video.iqiyi.com') 79 | return url 80 | 81 | 82 | if __name__ == '__main__': 83 | r = input('请输入爱奇艺直播房间号:\n') 84 | print(IQiYi(r).get_real_url()) 85 | -------------------------------------------------------------------------------- /scripts/lives/ixigua.py: -------------------------------------------------------------------------------- 1 | # 获取西瓜直播的真实流媒体地址。 2 | 3 | import re 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class IXiGua(Base): 11 | _name = '西瓜' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | try: 19 | headers = { 20 | 'user-agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:83.0) Gecko/20100101 Firefox/83.0' 21 | } 22 | room_url = 'https://live.ixigua.com/' + str(self.rid) 23 | response = requests.get(url=room_url, headers=headers).text 24 | real_url = re.findall(r'playInfo":([\s\S]*?),"authStatus', response)[0] 25 | real_url = re.sub(r'\\u002F', '/', real_url) 26 | except: 27 | return '直播间不存在或未开播' 28 | return real_url 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('请输入西瓜直播房间号:\n') 33 | print(IXiGua(r).get_real_url()) 34 | -------------------------------------------------------------------------------- /scripts/lives/jd.py: -------------------------------------------------------------------------------- 1 | # 京东直播:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=1807004&position=0 2 | 3 | import json 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class JD(Base): 11 | _name = '京东' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | url = 'https://api.m.jd.com/client.action' 19 | params = { 20 | 'functionId': 'liveDetail', 21 | 'body': json.dumps({'id': self.rid, 'videoType': 1}, separators=(',', ':')), 22 | 'client': 'wh5' 23 | } 24 | with requests.Session() as s: 25 | res = s.get(url, params=params).json() 26 | data = res.get('data', 0) 27 | if data: 28 | status = data['status'] 29 | if status == 1: 30 | real_url = data['h5Pull'] 31 | return real_url 32 | else: 33 | real_url = '回放:' + data.get('playBack').get('videoUrl', 0) 34 | return real_url 35 | else: 36 | return '直播间不存在' 37 | 38 | 39 | if __name__ == '__main__': 40 | r = input('请输入京东直播房间号:\n') 41 | print(JD(r).get_real_url()) 42 | -------------------------------------------------------------------------------- /scripts/lives/kbs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/22 8:02 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import hashlib 8 | import time 9 | from urllib.parse import parse_qsl, urlsplit 10 | 11 | import requests 12 | 13 | from scripts.base import Base 14 | 15 | 16 | class KBS(Base): 17 | """ 18 | - 腾讯体育直播,看比赛频道 https://kbs.sports.qq.com/ 19 | - 直播间地址类似:https://sports.qq.com/kbsweb/game.htm?mid=100006:2337840,需要其中的mid 20 | - 只能获取免费观看的直播间 21 | - 请求参数params中的defn:蓝光fhd、超清shd、高清hd、标清sd,未登陆时最高获取超清,蓝光需VIP。 22 | """ 23 | _name = '腾讯体育' 24 | 25 | def __init__(self, rid): 26 | super(Base, self).__init__() 27 | self.rid = rid 28 | 29 | def get_real_url(self): 30 | var = dict(parse_qsl(urlsplit(self.rid).query)) 31 | mid = var.get('mid') 32 | 33 | with requests.Session() as self.s: 34 | res = requests.get(f'https://matchweb.sports.qq.com/kbs/matchDetail?mid={mid}').json() 35 | self.vid = res['data']['liveId'] 36 | self.livepid = res['data']['programId'] 37 | tt = int(time.time()) 38 | week = int(time.strftime('%w')) 39 | s = ('06fc1464', '4244ce1b', '77de31c5', 'e0149fa2', '60394ced', '2da639f0', 'c2f0cf9f') 40 | ha = f'{s[week - 1]}{self.vid}{tt}*#06#40201' 41 | ckey = hashlib.md5(ha.encode('utf-8')).hexdigest() 42 | params = { 43 | 'cmd': 2, 44 | 'cnlid': self.vid, 45 | 'pla': 0, 46 | 'stream': 2, 47 | 'system': 0, 48 | 'appVer': '3.0.0.142', 49 | 'encryptVer': f'7.{7 if week == 0 else week}', 50 | 'qq': 0, 51 | 'device': 'PC', 52 | 'guid': 'f56776a1fa52e9c8c4987bfecfbf0503', 53 | 'defn': 'shd', # shd默认超清 54 | 'host': 'qq.com', 55 | 'livepid': self.livepid, 56 | 'logintype': 1, 57 | 'vip_status': 1, 58 | 'livequeue': 1, 59 | 'fntick': tt, 60 | 'tm': tt, 61 | 'sdtfrom': 1107, 62 | 'platform': 40201, 63 | 'cKey': ckey, 64 | 'queueStatus': 0, 65 | 'sphttps': 1, 66 | 'authext': '{}', 67 | 'auth_ext': '{}', 68 | 'auth_from': 40001, 69 | # 'callback': 'txvlive_videoinfoget_2767135792', 70 | } 71 | res = self.s.get('https://infozb6.video.qq.com/', params=params).json() 72 | playurl = res.get('playurl', 0) 73 | if res['errinfo']: 74 | return 'errinfo' 75 | else: 76 | return playurl 77 | 78 | 79 | if __name__ == '__main__': 80 | r = input('请输入腾讯体育直播间地址:\n') 81 | print(KBS(r).get_real_url()) 82 | -------------------------------------------------------------------------------- /scripts/lives/kk.py: -------------------------------------------------------------------------------- 1 | # KK直播:http://www.kktv5.com/ 2 | import requests 3 | 4 | from scripts.base import Base 5 | 6 | 7 | class KK(Base): 8 | _name = 'KK' 9 | 10 | def __init__(self, rid): 11 | super(Base, self).__init__() 12 | self.rid = rid 13 | 14 | def get_real_url(self): 15 | url = 'https://sapi.kktv1.com/meShow/entrance?parameter={}' 16 | parameter = {'FuncTag': 10005043, 'userId': '{}'.format(self.rid), 'platform': 1, 'a': 1, 'c': 100101} 17 | with requests.Session() as s: 18 | res = s.get(url.format(parameter)).json() 19 | tagcode = res['TagCode'] 20 | if tagcode == '00000000': 21 | if res.get('liveType', 0) == 1: 22 | roomid = res['roomId'] 23 | parameter = {'FuncTag': 60001002, 'roomId': roomid, 'platform': 1, 'a': 1, 'c': 100101} 24 | with requests.Session() as s: 25 | res = s.get(url.format(parameter)).json() 26 | real_url = res['liveStream'] 27 | return real_url 28 | else: 29 | return '未开播' 30 | else: 31 | return '直播间不存在' 32 | 33 | 34 | if __name__ == '__main__': 35 | r = input('输入KK直播房间号:\n') 36 | print(KK(r).get_real_url()) 37 | -------------------------------------------------------------------------------- /scripts/lives/kuaishou.py: -------------------------------------------------------------------------------- 1 | # 获取快手直播的真实流媒体地址,默认输出最高画质 2 | # https://live.kuaishou.com/u/KPL704668133 3 | # 如获取失败,尝试修改 cookie 中的 did 4 | 5 | import json 6 | import re 7 | 8 | import requests 9 | 10 | from scripts.base import Base 11 | 12 | 13 | class KuaiShou(Base): 14 | _name = '快手' 15 | 16 | def __init__(self, rid): 17 | super(Base, self).__init__() 18 | self.rid = rid 19 | 20 | def get_real_url(self): 21 | headers = { 22 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 ' 23 | '(KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', 24 | 'cookie': 'did=web_d563dca728d28b00336877723e0359ed'} 25 | with requests.Session() as s: 26 | res = s.get('https://m.gifshow.com/fw/live/{}'.format(self.rid), headers=headers) 27 | livestream = re.search(r'liveStream":(.*),"obfuseData', res.text) 28 | if livestream: 29 | livestream = json.loads(livestream.group(1)) 30 | *_, hlsplayurls = livestream['multiResolutionHlsPlayUrls'] 31 | urls, = hlsplayurls['urls'] 32 | url = urls['url'] 33 | return url 34 | else: 35 | return '直播间不存在或未开播' 36 | 37 | 38 | if __name__ == '__main__': 39 | # KPL704668133 40 | r = input('请输入快手直播房间ID:\n') 41 | print(KuaiShou(r).get_real_url()) 42 | -------------------------------------------------------------------------------- /scripts/lives/kugou.py: -------------------------------------------------------------------------------- 1 | # 获取酷狗繁星直播的真实流媒体地址,默认最高码率。 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class KuGou(Base): 9 | _name = '快手' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | try: 17 | response1 = requests.get( 18 | 'https://fx1.service.kugou.com/video/pc/live/pull/v3/streamaddr?roomId={}&ch=fx&version=1.0&streamType=1-2-5&platform=7&ua=fx-flash&kugouId=0&layout=1'.format( 19 | self.rid)).json() 20 | response2 = requests.get( 21 | 'https://fx1.service.kugou.com/video/mo/live/pull/h5/v3/streamaddr?roomId={}&platform=18&version=1000&streamType=3-6&liveType=1&ch=fx&ua=fx-mobile-h5&kugouId=0&layout=1'.format( 22 | self.rid)).json() 23 | real_url_flv = response1.get('data').get('horizontal')[0].get('httpflv')[0] 24 | real_url_hls = response2.get('data').get('horizontal')[0].get('httpshls')[0] 25 | except: 26 | return '直播间不存在或未开播' 27 | return {"flv": real_url_flv, "hls": real_url_hls} 28 | 29 | 30 | if __name__ == '__main__': 31 | r = input('请输入酷狗直播房间号:\n') 32 | print(KuGou(r).get_real_url()) 33 | -------------------------------------------------------------------------------- /scripts/lives/kuwo.py: -------------------------------------------------------------------------------- 1 | # 酷我聚星直播:http://jx.kuwo.cn/ 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class KuWo(Base): 9 | _name = '酷我聚星' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | with requests.Session() as s: 17 | res = s.get( 18 | 'https://zhiboserver.kuwo.cn/proxy.p?src=h5&cmd=enterroom&rid={}&videotype=1&auto=1'.format(self.rid)) 19 | res = res.json() 20 | try: 21 | livestatus = res['room']['livestatus'] 22 | except KeyError: 23 | return '房间号错误' 24 | if livestatus == 2: 25 | real_url = res['live']['url'] 26 | return real_url 27 | else: 28 | return '未开播' 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('输入酷我聚星直播房间号:\n') 33 | print(KuWo(r).get_real_url()) 34 | -------------------------------------------------------------------------------- /scripts/lives/laifeng.py: -------------------------------------------------------------------------------- 1 | # 获取来疯直播的真实流媒体地址。 2 | # 来疯直播就是优酷直播的个人主播频道,不同于优酷直播下的轮播台和体育直播。 3 | # 来疯直播间链接形式:https://v.laifeng.com/8032155 4 | 5 | import requests 6 | import re 7 | from scripts.base import Base 8 | 9 | 10 | class LaiFeng(Base): 11 | _name = '来疯' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | try: 19 | response_main = requests.get(url='http://v.laifeng.com/{}/m'.format(self.rid)).text 20 | stream_name = re.findall(r"initAlias:'(.*)?'", response_main)[0] 21 | real_url = {} 22 | for stream_format in ['HttpFlv', 'Hls']: 23 | request_url = 'https://lapi.lcloud.laifeng.com/Play?AppId=101&CallerVersion=2.0&StreamName={}&Action=Schedule&Version=2.0&Format={}'.format(stream_name, stream_format) 24 | response = requests.get(url=request_url).json() 25 | real_url[stream_format] = response.get(stream_format)[0].get('Url') 26 | except: 27 | return '该直播间不存在或未开播' 28 | return real_url 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('请输入来疯直播房间号:\n') 33 | print(LaiFeng(r).get_real_url()) 34 | -------------------------------------------------------------------------------- /scripts/lives/lehai.py: -------------------------------------------------------------------------------- 1 | # 乐嗨直播:https://www.lehaitv.com/ 2 | 3 | import hashlib 4 | import time 5 | from urllib.parse import unquote 6 | from urllib.parse import urlencode 7 | 8 | import requests 9 | 10 | from scripts.base import Base 11 | 12 | 13 | class LeHai(Base): 14 | _name = '乐嗨' 15 | 16 | def __init__(self, rid): 17 | super(Base, self).__init__() 18 | self.rid = rid 19 | 20 | def get_real_url(self): 21 | url = 'https://service.lehaitv.com/v2/room/{}/enter'.format(self.rid) 22 | params = { 23 | '_st1': int(time.time() * 1e3), 24 | 'accessToken': 's7FUbTJ%2BjILrR7kicJUg8qr025ZVjd07DAnUQd8c7g%2Fo4OH9pdSX6w%3D%3D', 25 | 'tku': 3000006, 26 | } 27 | data = urlencode(params) + '1eha12h5' 28 | _ajaxData1 = hashlib.md5(data.encode('utf-8')).hexdigest() 29 | params['_ajaxData1'] = _ajaxData1 30 | params['accessToken'] = unquote(params['accessToken']) 31 | with requests.Session() as s: 32 | res = s.get(url, params=params) 33 | if res.status_code == 200: 34 | res = res.json() 35 | statuscode = res['status']['statuscode'] 36 | if statuscode == '0': 37 | if res['data']['live_status'] == '1': 38 | anchor, = res['data']['anchor'] 39 | real_url = anchor['media_url'] 40 | return real_url 41 | else: 42 | return '未开播' 43 | else: 44 | return '房间不存在 或 权限检查错误' 45 | else: 46 | return '请求错误' 47 | 48 | 49 | if __name__ == '__main__': 50 | r = input('输入乐嗨直播房间号:\n') 51 | print(LeHai(r).get_real_url()) 52 | -------------------------------------------------------------------------------- /scripts/lives/liveu.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/8/15 14:09 3 | # @Project: my-spiders 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import requests 8 | 9 | from scripts.base import Base 10 | 11 | 12 | class liveU(Base): 13 | _name = 'liveu' 14 | 15 | def __init__(self, rid): 16 | super(Base, self).__init__() 17 | self.rid = rid 18 | 19 | def get_real_url(self): 20 | with requests.Session() as s: 21 | url = f'https://mobile.liveu.me/appgw/v2/watchstartweb?sessionid=&vid={self.rid}' 22 | res = s.get(url).json() 23 | play_url = res['retinfo']['play_url'] if res['retval'] == 'ok' else '不存在或未开播' 24 | return play_url 25 | 26 | 27 | if __name__ == '__main__': 28 | r = input('输入liveU直播房间号:\n') 29 | print(liveU(r).get_real_url()) 30 | -------------------------------------------------------------------------------- /scripts/lives/longzhu.py: -------------------------------------------------------------------------------- 1 | # 获取龙珠直播的真实流媒体地址,默认最高码率。 2 | 3 | import re 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class LongZhu(Base): 11 | _name = '龙珠' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | try: 19 | response = requests.get('http://star.longzhu.com/' + str(self.rid)).text 20 | roomId = re.findall(r'roomid":(\d+)', response)[0] 21 | response = requests.get( 22 | 'http://livestream.longzhu.com/live/getlivePlayurl?roomId={}&utmSr=&platform=h5&device=ios'.format( 23 | roomId)).json() 24 | real_url = response.get('playLines')[0].get('urls')[0].get('securityUrl') 25 | except: 26 | return '直播间不存在或未开播' 27 | return real_url 28 | 29 | 30 | if __name__ == '__main__': 31 | r = input('请输入龙珠直播房间号:\n') 32 | print(LongZhu(r).get_real_url()) 33 | -------------------------------------------------------------------------------- /scripts/lives/look.py: -------------------------------------------------------------------------------- 1 | # 获取网易云音乐旗下look直播的真实流媒体地址。 2 | # look直播间链接形式:https://look.163.com/live?id=73694082 3 | 4 | # 以下核心加密解密算法来自:https://github.com/Qinjiaxin/MusicBox/blob/b8f716d43d/MusicPlayer/apis/netEaseEncode.py 5 | # 分析过程可参看 https://github.com/Qinjiaxin/MusicBox/blob/b8f716d43d/doc/analysis/analyze_captured_data.md 6 | 7 | # 加密参数相关。 8 | # 具体http://s3.music.126.net/sep/s/2/core.js?5d6f8e4d01b4103ec9f246a2ef70e6d1在这个js中可以查看。 9 | # 好吧,其实不用分析这个js,在这个git中可以找到https://github.com/xiyouMc/ncmbot,不过他是for python2的。 10 | # 针对pyton3做了修改。 11 | 12 | import base64 13 | import binascii 14 | import json 15 | import random 16 | 17 | import requests 18 | from Crypto.Cipher import AES 19 | 20 | from scripts.base import Base 21 | 22 | modulus = '00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7' 23 | nonce = b'0CoJUm6Qyw8W8jud' 24 | pubKey = '010001' 25 | 26 | 27 | def aes_encrypt(text, secKey): 28 | pad = 16 - len(text) % 16 29 | 30 | # aes加密需要byte类型。 31 | # 因为调用两次,下面还要进行补充位数。 32 | # 直接用try与if差不多。 33 | 34 | try: 35 | text = text.decode() 36 | except: 37 | pass 38 | 39 | text = text + pad * chr(pad) 40 | try: 41 | text = text.encode() 42 | except: 43 | pass 44 | 45 | encryptor = AES.new(secKey, 2, bytes('0102030405060708', 'utf-8')) 46 | ciphertext = encryptor.encrypt(text) 47 | ciphertext = base64.b64encode(ciphertext) 48 | return ciphertext 49 | 50 | 51 | def create_secret_key(size): 52 | # 2中 os.urandom返回是个字符串。3中变成bytes。 53 | # 不过加密的目的是需要一个字符串。 54 | # 因为密钥之后会被加密到rsa中一起发送出去。 55 | # 所以即使是个固定的密钥也是可以的。 56 | 57 | # return (''.join(map(lambda xx: (hex(ord(xx))[2:]), os.urandom(size))))[0:16] 58 | return bytes(''.join(random.sample('1234567890qwertyuipasdfghjklzxcvbnm', size)), 'utf-8') 59 | 60 | 61 | def rsa_encrypt(text, pub_key, modulus): 62 | text = text[::-1] 63 | # 3中将字符串转成hex的函数变成了binascii.hexlify, 2中可以直接 str.encode('hex') 64 | rs = int(binascii.hexlify(text), 16) ** int(pub_key, 16) % int(modulus, 16) 65 | return format(rs, 'x').zfill(256) 66 | 67 | 68 | def encrypted_request(text): 69 | # 这边是加密过程。 70 | text = json.dumps(text) 71 | sec_key = create_secret_key(16) 72 | enc_text = aes_encrypt(aes_encrypt(text, nonce), sec_key) 73 | enc_sec_key = rsa_encrypt(sec_key, pubKey, modulus) 74 | # 在那个js中也可以找到。 75 | # params加密后是个byte,解下码。 76 | return {'params': enc_text.decode(), 'encSecKey': enc_sec_key} 77 | 78 | 79 | class Look(Base): 80 | _name = 'LOOK' 81 | 82 | def __init__(self, rid): 83 | super(Base, self).__init__() 84 | self.rid = rid 85 | 86 | def get_real_url(self): 87 | try: 88 | request_data = encrypted_request({"liveRoomNo": self.rid}) 89 | response = requests.post(url='https://api.look.163.com/weapi/livestream/room/get/v3', 90 | data=request_data) 91 | real_url = response.json()['data']['roomInfo']['liveUrl'] 92 | 93 | except: 94 | return '直播间不存在或未开播' 95 | return real_url 96 | 97 | 98 | if __name__ == '__main__': 99 | r = input('请输入Look直播房间号:\n') 100 | print(Look(r).get_real_url()) 101 | -------------------------------------------------------------------------------- /scripts/lives/maoer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/1 13:03 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import json 8 | 9 | import requests 10 | 11 | from scripts.base import Base 12 | 13 | 14 | class MAOER(Base): 15 | _name = '猫耳' 16 | 17 | def __init__(self, rid): 18 | super(Base, self).__init__() 19 | self.rid = rid 20 | 21 | def get_real_url(self): 22 | headers = { 23 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, ' 24 | 'like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 ' 25 | } 26 | url = 'https://fm.missevan.com/api/v2/live/{}'.format(self.rid) 27 | with requests.Session() as s: 28 | res = s.get(url, headers=headers).json() 29 | try: 30 | code = res['code'] 31 | if code != 0: 32 | return res['info'] 33 | else: 34 | channel = res['info']['room']['channel'] 35 | return channel 36 | except json.decoder.JSONDecodeError: 37 | return '输入错误' 38 | 39 | 40 | if __name__ == '__main__': 41 | r = input('请输入猫耳直播房间号:\n') 42 | print(MAOER(r).get_real_url()) 43 | -------------------------------------------------------------------------------- /scripts/lives/migu.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/11/6 10:51 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import requests 8 | from urllib import parse 9 | from scripts.base import Base 10 | 11 | 12 | class MiGu(Base): 13 | """ 14 | 获取咪咕体育直播的流媒体地址 15 | 直播列表:https://www.miguvideo.com/mgs/website/prd/sportMatchDetail.html 16 | 直播间地址形式:https://www.miguvideo.com/mgs/website/prd/sportLive.html?mgdbId=120000173758 17 | mgdbId 120000173758即为房间号 18 | """ 19 | _name = '咪咕' 20 | 21 | def __init__(self, rid): 22 | """ 23 | Args: 24 | rate:估计是清晰度,默认rate=3是高清 25 | rid:房间号,如 120000173758 26 | """ 27 | super(MiGu, self).__init__() 28 | self.rid = rid 29 | 30 | def get_real_url(self, rate=3): 31 | """ 32 | 先获取contId 33 | Returns: 34 | url 35 | """ 36 | self.rate = rate 37 | headers = { 38 | 'appId': 'miguvideo', 39 | 'clientId': '', 40 | 'SDKCEId': '', 41 | 'terminalId': 'www', 42 | 'userId': '', 43 | 'userToken': '', 44 | 'X-UP-CLIENT-CHANNEL-ID': '', 45 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 46 | 'Chrome/95.0.4638.69 Safari/537.36', 47 | 'Referer': 'https://www.miguvideo.com/', 48 | } 49 | url = 'https://app-sc.miguvideo.com/vms-match/v3/staticcache/basic/basic-data/{}'.format(self.rid) 50 | 51 | with requests.Session() as session: 52 | res = session.get(url, headers=headers).json() 53 | try: 54 | contid = res['body']['pId'] 55 | url = f'https://webapi.miguvideo.com/gateway/playurl/v3/play/playurl?contId={contid}&rateType={self.rate}' 56 | res = session.get(url, headers=headers).json() 57 | try: 58 | playurl = res['body']['urlInfo']['url'] 59 | real_url = self.calcu(playurl) 60 | return real_url 61 | except KeyError: 62 | return '未获取到url,可能参数错误!' 63 | except KeyError: 64 | return '未获取到contId' 65 | 66 | @staticmethod 67 | def calcu(pre_url): 68 | """ 69 | 计算ddCalcu,原始过程在pcPlayer.js的9432行到9460行。 70 | 这里直接用python代码还原,其实可以简化。 71 | Args: 72 | pre_url:playurl请求返回的url用来拼接计算ddCalcu 73 | Returns: 74 | real_url:添加ddCalcu后的播放地址 75 | """ 76 | params = dict(parse.parse_qsl(pre_url.split('?')[-1])) 77 | t = 'eeeeeeeee' 78 | r = str(params['timestamp']) 79 | n = str(params['ProgramID']) 80 | a = params['Channel_ID'] 81 | o = params['puData'] 82 | # s = '2624' 83 | # js里是遍历s,这里直接写死 84 | u = t[2] or 'e' 85 | ll = r[6] or 't' 86 | c = n[2] or "c" 87 | f = a[len(a) - 4] or 'n' 88 | d = o 89 | h = [] 90 | for p in range(0, int(len(d) / 2)): 91 | h.append(d[len(d) - p - 1]) 92 | if p < len(d) - p - 1: 93 | h.append(o[p]) 94 | x = { 95 | 1: u, 96 | 2: ll, 97 | 3: c, 98 | 4: f 99 | } 100 | h.append(x[p]) if p in [1, 2, 3, 4] else '' 101 | v = ''.join(h) 102 | real_url = pre_url + '&ddCalcu=' + v 103 | return real_url 104 | 105 | 106 | if __name__ == '__main__': 107 | rr = input('请输入咪咕直播间号:\n') 108 | -------------------------------------------------------------------------------- /scripts/lives/now.py: -------------------------------------------------------------------------------- 1 | # 获取NOW直播的真实流媒体地址。 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class Now(Base): 9 | _name = 'NOW' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | try: 17 | room_url = 'https://now.qq.com/cgi-bin/now/web/room/get_live_room_url?room_id={}&platform=8'.format( 18 | self.rid) 19 | response = requests.get(url=room_url).json() 20 | result = response.get('result') 21 | real_url = { 22 | 'raw_hls_url': result.get('raw_hls_url', 0), 23 | 'raw_rtmp_url': result.get('raw_rtmp_url', 0), 24 | 'raw_flv_url': result.get('raw_flv_url', 0) 25 | } 26 | except: 27 | return '直播间不存在或未开播' 28 | return real_url 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('请输入NOW直播间号:\n') 33 | print(Now(r)) 34 | -------------------------------------------------------------------------------- /scripts/lives/pps.py: -------------------------------------------------------------------------------- 1 | # 获取PPS奇秀直播的真实流媒体地址。 2 | 3 | import re 4 | import time 5 | 6 | import requests 7 | 8 | from scripts.base import Base 9 | 10 | 11 | class PPS(Base): 12 | _name = 'PPS奇秀' 13 | 14 | def __init__(self, rid): 15 | super(Base, self).__init__() 16 | self.rid = rid 17 | 18 | def get_real_url(self): 19 | try: 20 | response = requests.get('http://m-x.pps.tv/room/' + str(self.rid)).text 21 | anchor_id = re.findall(r'anchor_id":(\d*),"online_uid', response)[0] 22 | tt = int(time.time() * 1000) 23 | url = 'http://m-x.pps.tv/api/stream/getH5?qd_tm={}&typeId=1&platform=7&vid=0&qd_vip=0&qd_uid={}&qd_ip=114.114.114.114&qd_vipres=0&qd_src=h5_xiu&qd_tvid=0&callback='.format( 24 | tt, anchor_id) 25 | headers = { 26 | 'Content-Type': 'application/x-www-form-urlencoded', 27 | 'Referer': 'http://m-x.pps.tv/' 28 | } 29 | response = requests.get(url=url, headers=headers).text 30 | real_url = re.findall(r'"hls":"(.*)","rate_list', response)[0] 31 | except: 32 | return '直播间不存在或未开播' 33 | return real_url 34 | 35 | 36 | if __name__ == '__main__': 37 | r = input('请输入奇秀直播房间号:\n') 38 | print(PPS(r).get_real_url()) 39 | -------------------------------------------------------------------------------- /scripts/lives/ppsport.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/4 15:11 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import base64 8 | import binascii 9 | from urllib.parse import parse_qsl, urlsplit, urlencode 10 | 11 | import requests 12 | from Crypto.Cipher import AES, DES3 13 | from Crypto.Cipher import PKCS1_v1_5 14 | from Crypto.Hash import SHA256 15 | from Crypto.PublicKey import RSA 16 | 17 | from scripts.base import Base 18 | 19 | 20 | def des_encrypt(text, key, iv): 21 | """ 22 | DES加密 23 | """ 24 | key = binascii.a2b_hex(key) 25 | iv = binascii.a2b_hex(iv) 26 | pad = 8 - len(text) % 8 27 | text = text + pad * chr(pad) 28 | text = text.encode() 29 | cipher = DES3.new(key, DES3.MODE_CBC, iv) 30 | encrypt_bytes = cipher.encrypt(text) 31 | return base64.b64encode(encrypt_bytes).decode('utf-8') 32 | 33 | 34 | def rsa_encrypt(text): 35 | """ 36 | RSA加密 37 | :param text: 38 | :return: 39 | """ 40 | pub_key = '-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqe6XLQF2JmXWgfh09t8TTZsOb6bnj' \ 41 | '+duiWw4G7pd5Uo1/DN7Xij3Tys9E7XBX0gdXKYI9j+6Fr45bM28fzl4AxUxnhzmbExRt1NJarDGMKo49ViRg1VbL+Wh9kRi' \ 42 | '+rAxBisdRiP2JEAL+Awqu80chZxxdyoI1k3fSLoZsv/PGkwolE71qsEM4BO1J9RWNp0wlNGqgR' \ 43 | '+bTwLKkoe7oiZaKaMsSBWNIBDkwgGKFJZzXMXMnqGsDmfbdi32j6hW9DdrxjCx' \ 44 | '/i9Nzahd1TWVnw9O1AHL5PD5kM3HzqkAewBu38sZxw8DSGYqG0fgVAQtiLHhlD/19F4NKxqL8IVCinMBHQIDAQAB\n-----END ' \ 45 | 'PUBLIC KEY----- ' 46 | pub_key = RSA.importKey(pub_key) 47 | cipher = PKCS1_v1_5.new(pub_key) 48 | rsa_text = base64.b64encode(cipher.encrypt(bytes(text.encode("utf8")))) 49 | return rsa_text.decode('utf-8') 50 | 51 | 52 | def encrypt(params): 53 | """ 54 | encrypt_params是DES3加密,cipher是RSA加密 55 | :param params: 56 | :return: 57 | """ 58 | key = 'DB30EB9226014FEC2A04C6A7BE47F22853B6621BD6989D83' 59 | iv = '6795646FD1F8CC95' 60 | encrypt_params = des_encrypt(urlencode(params, safe=','), key, iv) 61 | cipher = rsa_encrypt(f'{key},{iv}') 62 | en_params = { 63 | 'cipher': cipher, 64 | 'encryptParams': encrypt_params, 65 | 'vvId': '295b5e4a-4a77-442a-8594-36c47c87d6c5', 66 | # 'format': 'jsonp' 67 | } 68 | return en_params 69 | 70 | 71 | def aes_decrypt(text, key): 72 | """ 73 | aes解密,ECB模式,key先hash 74 | :param text:密文 75 | :param key:key 76 | :return: 77 | """ 78 | h = SHA256.new() 79 | h.update(key.encode()) 80 | key = h.hexdigest() 81 | key = binascii.a2b_hex(key) 82 | cipher = AES.new(key, AES.MODE_ECB) 83 | text = binascii.a2b_hex(text) 84 | decrypt_key = cipher.decrypt(text) 85 | return binascii.b2a_hex(decrypt_key).decode() 86 | 87 | 88 | class PPSport(Base): 89 | """ 90 | 链接样式:http://sports.pptv.com/sportslive/pg_h5live?sectionid=184978 91 | 92 | - liveFlag=1 正在直播 93 | - liveFlag=2 没有直播,有录像集锦 94 | - liveFlag 为空,没有录像 95 | 96 | 非VIP最高获取1280P 97 | """ 98 | _name = 'PP体育' 99 | 100 | def __init__(self, rid): 101 | super(Base, self).__init__() 102 | self.rid = rid 103 | 104 | 105 | def get_real_url(self): 106 | """ 107 | PPSport原网页中会把下面的params加密后再发送请求,用上面的encrypt,这里请求参数不加密也可以 108 | :return:url 109 | """ 110 | # 拆分sectionid 111 | var = dict(parse_qsl(urlsplit(self.rid).query)) 112 | sectionid = var.get('sectionid') 113 | if sectionid: 114 | self.sectionid = sectionid 115 | else: 116 | raise Exception('Invalid link!') 117 | # 获取cid 118 | with requests.Session() as self.s: 119 | res = self.s.get(f'http://sportlive.suning.com/slsp-web/cms/competitionschedule/v1/detail/section.do?sectionid={sectionid}').json() 120 | 121 | self.liveflag = res['data'].get('liveFlag') 122 | 123 | if self.liveflag == '1': 124 | # 正在直播 125 | self.cid = res['data']['sectionInfo']['lives'][0]['cid'] 126 | elif self.liveflag == '2': 127 | # 录像 128 | try: 129 | self.cid = res['data']['sectionInfo']['lives'][0]['afterCid'] 130 | except KeyError: 131 | # 没有录像 132 | return 'No streaming!' 133 | else: 134 | return 'liveflag error!' 135 | 136 | params = { 137 | 'type': 'mhpptv', 138 | 'appId': 'pptv.web.h5', 139 | 'appPlt': 'web', 140 | 'appVer': '1.0.4', 141 | 'channel': 'sn.cultural', 142 | 'sdkVer': '1.5.0', 143 | 'cid': self.cid, 144 | 'allowFt': '0,1,2,3', 145 | 'rf': 0, 146 | 'ppi': '302c3530', 147 | 'o': 0, 148 | 'ahl_ver': 1, 149 | 'ahl_random': '374b7d5d453b2c4d2e2e327452434168', 150 | 'ahl_signa': '552aed5c0f2d2e561cd55991925ae817add78ceb86ede3ecac08dd4df6a31f78', 151 | 'version': 1, 152 | 'streamFormat': 1, 153 | 'videoFormat': 'm3u8', 154 | 'vvId': '295b5e4a-4a77-442a-8594-36c47c87d6c5', 155 | } 156 | # params = encrypt(params) 157 | headers = { 158 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 159 | 'Chrome/90.0.4430.93 Safari/537.36 ', 160 | } 161 | res = self.s.get('http://oneplay.api.pptv.com/ups-service/play', headers=headers, params=params) 162 | res = res.json() 163 | 164 | if res.get('code', 1) == 0: 165 | if self.liveflag == '1': 166 | # 正在直播 167 | vod2 = res['data']['program']['media']['resource']['stream']['live2'] 168 | else: 169 | # 录像集锦 170 | vod2 = res['data']['program']['media']['resource']['vod2'] 171 | 172 | delay = vod2.get('delay') 173 | interval = vod2.get('interval') 174 | 175 | item = vod2['item'][-1] 176 | dt = item['dt'] 177 | rid = item['rid'].split('.')[0] 178 | 179 | if self.liveflag == '1': 180 | h = dt['sh']['content'] + dt['st'] + dt['bh']['content'] + dt['iv'] + 'V8oo0Or1f047NaiMTxK123LMFuINTNeI' 181 | else: 182 | h = dt['sh'] + dt['st'] + dt['id'] + dt['bh'] + dt['iv'] + 'V8oo0Or1f047NaiMTxK123LMFuINTNeI' 183 | 184 | key = dt['key']['content'] 185 | key, n = key.split('-', 1) 186 | # 解密获取k 187 | k = aes_decrypt(key, h) + '-' + n 188 | k = { 189 | 'h5vod.ver': '2.1.5', 190 | 'k': k, 191 | 'vvid': '295b5e4a-4a77-442a-8594-36c47c87d6c5', 192 | 'type': 'mhpptv', 193 | 'o': 0, 194 | 'sv': '4.1.18', 195 | } 196 | 197 | url = f"http://{dt['bh']['content']}/live/{interval}/{delay}/{rid}.m3u8?playback=0&{urlencode(k)}" \ 198 | if self.liveflag == '1' else f"http://{dt['bh']}/{rid}.m3u8?fpp.ver=1.0.0&{urlencode(k)}" 199 | return url 200 | else: 201 | return 'Invalid parameters' 202 | 203 | 204 | if __name__ == '__main__': 205 | r = input('请输入PP体育直播间地址:\n') 206 | print(PPSport(r).get_real_url()) 207 | -------------------------------------------------------------------------------- /scripts/lives/qf.py: -------------------------------------------------------------------------------- 1 | # 获取56千帆直播的真实流媒体地址。 2 | # 千帆直播直播间链接形式:https://qf.56.com/520686 3 | 4 | import re 5 | 6 | import requests 7 | 8 | from scripts.base import Base 9 | 10 | 11 | class QF(Base): 12 | _name = '千帆' 13 | 14 | def __init__(self, rid): 15 | super(Base, self).__init__() 16 | self.rid = rid 17 | 18 | def get_real_url(self): 19 | try: 20 | response = requests.post(url='https://qf.56.com/' + self.rid).text 21 | real_url = re.findall(r"flvUrl:'(.*)\?wsSecret", response) 22 | real_url = real_url[0] 23 | except: 24 | return '直播间不存在或未开播' 25 | return real_url 26 | 27 | 28 | if __name__ == '__main__': 29 | r = input('请输入千帆直播房间号:\n') 30 | print(QF(r).get_real_url()) 31 | -------------------------------------------------------------------------------- /scripts/lives/qie.py: -------------------------------------------------------------------------------- 1 | # 企鹅体育:https://live.qq.com/directory/all 2 | 3 | import requests 4 | import re 5 | 6 | from scripts.base import Base 7 | 8 | 9 | class ESport(Base): 10 | _name = '企鹅体育' 11 | 12 | def __init__(self, rid): 13 | super(Base, self).__init__() 14 | self.rid = rid 15 | 16 | def get_real_url(self): 17 | with requests.Session() as s: 18 | res = s.get('https://m.live.qq.com/' + str(self.rid)) 19 | show_status = re.search(r'"show_status":"(\d)"', res.text) 20 | if show_status: 21 | if show_status.group(1) == '1': 22 | hls_url = re.search(r'"hls_url":"(.*)","use_p2p"', res.text).group(1) 23 | return hls_url 24 | else: 25 | return '未开播' 26 | else: 27 | return '直播间不存在' 28 | 29 | 30 | if __name__ == '__main__': 31 | r = input('请输入企鹅体育直播房间号:\n') 32 | print(ESport(r).get_real_url()) 33 | -------------------------------------------------------------------------------- /scripts/lives/renren.py: -------------------------------------------------------------------------------- 1 | # 人人直播:http://zhibo.renren.com/ 2 | 3 | import re 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class RenRen(Base): 11 | _name = '人人' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | with requests.Session() as s: 19 | res = s.get('http://activity.renren.com/liveroom/' + str(self.rid)) 20 | livestate = re.search(r'"liveState":(\d)', res.text) 21 | if livestate: 22 | try: 23 | s = re.search(r'"playUrl":"([\s\S]*?)"', res.text).group(1) 24 | if livestate.group(1) == '0': 25 | return s 26 | elif livestate.group(1) == '1': 27 | return '回放:' + s 28 | except IndexError: 29 | return '解析错误' 30 | else: 31 | return '直播间不存在' 32 | 33 | 34 | if __name__ == '__main__': 35 | r = input('请输入人人直播房间号:\n') 36 | print(RenRen(r).get_real_url()) 37 | -------------------------------------------------------------------------------- /scripts/lives/showself.py: -------------------------------------------------------------------------------- 1 | # 秀色直播:https://www.showself.com/ 2 | 3 | from urllib.parse import urlencode 4 | import requests 5 | import time 6 | import hashlib 7 | from scripts.base import Base 8 | 9 | 10 | class ShowSelf(Base): 11 | _name = '秀色' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | with requests.Session() as s: 19 | res = s.get('https://service.showself.com/v2/custuser/visitor').json() 20 | uid = res['data']['uid'] 21 | accesstoken = sessionid = res['data']['sessionid'] 22 | params = { 23 | 'accessToken': accesstoken, 24 | 'tku': uid, 25 | '_st1': int(time.time() * 1000) 26 | } 27 | payload = { 28 | 'groupid': '999', 29 | 'roomid': self.rid, 30 | 'sessionid': sessionid, 31 | 'sessionId': sessionid 32 | } 33 | data = dict(params, **payload) 34 | data = urlencode(sorted(data.items(), key=lambda d: d[0])) + 'sh0wselfh5' 35 | _ajaxData1 = hashlib.md5(data.encode('utf-8')).hexdigest() 36 | payload['_ajaxData1'] = _ajaxData1 37 | url = 'https://service.showself.com/v2/rooms/{}/members?{}'.format(self.rid, urlencode(params)) 38 | with requests.Session() as s: 39 | res = s.post(url, json=payload) 40 | if res.status_code == 200: 41 | res = res.json() 42 | statuscode = res['status']['statuscode'] 43 | if statuscode == '0': 44 | if res['data']['roomInfo']['live_status'] == '1': 45 | anchor, = res['data']['roomInfo']['anchor'] 46 | real_url = anchor['media_url'] 47 | return real_url 48 | else: 49 | return '未开播' 50 | else: 51 | return '房间不存在' 52 | else: 53 | return '参数错误' 54 | 55 | 56 | if __name__ == '__main__': 57 | rid = input('输入秀色直播房间号:\n') 58 | print(ShowSelf(rid).get_real_url()) 59 | -------------------------------------------------------------------------------- /scripts/lives/sports_iqiyi.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/6/19 20:39 3 | # @Project: my-spiders 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | 8 | import binascii 9 | import hashlib 10 | import json 11 | import re 12 | import time 13 | from urllib.parse import urlencode 14 | 15 | import execjs 16 | import requests 17 | 18 | from scripts.base import Base 19 | 20 | 21 | class sIQiYi(Base): 22 | _name = '爱奇艺体育' 23 | 24 | def __init__(self, rid): 25 | super(Base, self).__init__() 26 | url = rid 27 | self.rid = url.split('/')[-1] 28 | self.s = requests.Session() 29 | 30 | def decodeurl(self): 31 | """ 32 | 传入url地址,截取url中的直播间id 33 | 字符串lgqipu倒序后转为十进制数,作为qpid解码的传参 34 | Returns: 35 | qpid 36 | """ 37 | o = 'lgqipu' 38 | o = int(binascii.hexlify(o[::-1].encode()), 16) 39 | 40 | s = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' 41 | a = 0 42 | rr = enumerate(self.rid) 43 | for i, _ in rr: 44 | a += s.index(_) * pow(36, len(self.rid) - (i + 1)) 45 | 46 | a = f'{a:b}' 47 | n = f'{o:b}' 48 | x = len(a) 49 | y = len(n) 50 | if x > y: 51 | i = a[:x - y] 52 | a = a[x - y:] 53 | else: 54 | i = n[:y - x] 55 | n = n[y - x:] 56 | 57 | for rs, ele in enumerate(a): 58 | if ele == n[rs]: 59 | i += '0' 60 | else: 61 | i += '1' 62 | qpid = int(i, 2) 63 | return qpid 64 | 65 | def get_real_url(self): 66 | """ 67 | 里面iqiyi.js是个加盐的md5,execjs执行后获取cmd5x的返回值 68 | Returns: 69 | m3u8格式播放地址 70 | Raises: 71 | Could not find an available JavaScript runtime: 是否安装了js环境 72 | """ 73 | qpid = self.decodeurl() 74 | uid = 'ba4fe551bd889d73f3d321d2fadc6130' 75 | ve = hashlib.md5(f'{qpid}function getTime() {{ [native code] }}{uid}'.encode('utf-8')).hexdigest() 76 | v = { 77 | 'lp': qpid, 78 | 'src': '01014351010000000000', 79 | 'ptid': '02037251010000000000', 80 | 'uid': '', 81 | 'rateVers': 'H5_QIYI', 82 | 'k_uid': uid, 83 | 'qdx': 'n', 84 | 'qdv': 3, 85 | 'dfp': '', 86 | 've': ve, 87 | 'v': 1, 88 | 'k_err_retries': 0, 89 | 'tm': int(time.time()), 90 | 'k_ft4': 17179869185, 91 | 'k_ft1': 141287244169216, 92 | 'k_ft5': 1, 93 | 'qd_v': 1, 94 | 'qdy': 'a', 95 | 'qds': 0, 96 | # 'callback': 'Q3d080ff19d8f233acb05683bf38e3a15', 97 | # 'vf': 'f0b986f100ae81fff8e8f8f96053e815', 98 | } 99 | k = '/jp/live?' + urlencode(v) 100 | cb = hashlib.md5(k.encode('utf-8')).hexdigest() 101 | k = f'{k}&callback=Q{cb}' 102 | 103 | # 生成vf 104 | with open('iqiyi.js', 'r') as f: 105 | content = f.read() 106 | try: 107 | cmd5x = execjs.compile(content) 108 | vf = cmd5x.call('cmd5x', k) 109 | except RuntimeError: 110 | return 'Could not find an available JavaScript runtime.' 111 | 112 | # 请求url 113 | url = f'https://live.video.iqiyi.com{k}&vf={vf}' 114 | res = self.s.get(url).text 115 | data = re.search(r'try{\w{33}\(([\w\W]+)\s\);}catch\(e\){};', res).group(1) 116 | data = json.loads(data) 117 | if data['code'] == 'A00004': 118 | return '直播间地址错误!' 119 | elif data['code'] == 'A00000': 120 | try: 121 | url = data['data']['streams'][-1]['url'] 122 | except IndexError: 123 | return '可能直播未开始直播或为付费直播!' 124 | else: 125 | return '无法定位错误原因,可提交issue!' 126 | return url 127 | 128 | 129 | if __name__ == '__main__': 130 | r = input('请输入爱奇艺体育直播间完整地址地址,注意只能获取免费直播:\n') 131 | # https://sports.iqiyi.com/resource/pcw/live/gwbgbfbgc3 132 | print(sIQiYi(r).get_real_url()) 133 | -------------------------------------------------------------------------------- /scripts/lives/tiktok.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/2 23:23 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import re 8 | 9 | import requests 10 | 11 | from scripts.base import Base 12 | 13 | 14 | class TikTok(Base): 15 | _name = 'TIKTOK' 16 | 17 | def __init__(self, rid): 18 | super(Base, self).__init__() 19 | self.rid = rid 20 | 21 | def get_real_url(self): 22 | headers = { 23 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, ' 24 | 'like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1', 25 | } 26 | res = requests.get(self.rid, headers=headers).text 27 | url = re.search(r'"LiveUrl":"(.*?m3u8)",', res) 28 | 29 | if url: 30 | return url.group(1) 31 | else: 32 | return 'link invalid' 33 | 34 | 35 | if __name__ == '__main__': 36 | # https://vm.tiktok.com/ZMe45tomE 37 | r = input('请输入 TikTok 分享链接:\n') 38 | print(TikTok(r).get_real_url()) 39 | -------------------------------------------------------------------------------- /scripts/lives/tuho.py: -------------------------------------------------------------------------------- 1 | # 星光直播:https://www.tuho.tv/28545037 2 | 3 | import re 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class TuHo(Base): 11 | _name = '星光' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | with requests.Session() as s: 19 | res = s.get('https://www.tuho.tv/' + str(self.rid)).text 20 | flv = re.search(r'videoPlayFlv":"(https[\s\S]+?flv)', res) 21 | if flv: 22 | status = re.search(r'isPlaying\s:\s(\w+),', res).group(1) 23 | if status == 'true': 24 | real_url = flv.group(1).replace('\\', '') 25 | return real_url 26 | else: 27 | return '未开播' 28 | else: 29 | return '直播间不存在' 30 | 31 | 32 | if __name__ == '__main__': 33 | r = input('输入星光直播房间号:\n') 34 | print(TuHo(r).get_real_url()) 35 | -------------------------------------------------------------------------------- /scripts/lives/twitch.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/2 16:20 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import json 8 | import re 9 | from urllib.parse import urlencode 10 | 11 | # twitch 直播需要科学上网 12 | import requests 13 | 14 | from scripts.base import Base 15 | 16 | 17 | class Twitch(Base): 18 | _name = 'twitch'.upper() 19 | 20 | def __init__(self, rid): 21 | super(Base, self).__init__() 22 | # rid = channel_name 23 | self.rid = rid 24 | with requests.Session() as self.s: 25 | pass 26 | 27 | def get_client_id(self): 28 | try: 29 | res = self.s.get(f'https://www.twitch.tv/{self.rid}').text 30 | client_id = re.search(r'"Client-ID":"(.*?)"', res).group(1) 31 | return client_id 32 | except requests.exceptions.ConnectionError: 33 | raise Exception('ConnectionError') 34 | 35 | def get_sig_token(self): 36 | data = { 37 | "operationName": "PlaybackAccessToken_Template", 38 | "query": "query PlaybackAccessToken_Template($login: String!, $isLive: Boolean!, $vodID: ID!, " 39 | "$isVod: Boolean!, $playerType: String!) { streamPlaybackAccessToken(channelName: $login, " 40 | "params: {platform: \"web\", playerBackend: \"mediaplayer\", playerType: $playerType}) @include(" 41 | "if: $isLive) { value signature __typename } videoPlaybackAccessToken(id: $vodID, " 42 | "params: {platform: \"web\", playerBackend: \"mediaplayer\", playerType: $playerType}) @include(" 43 | "if: $isVod) { value signature __typename }}", 44 | "variables": { 45 | "isLive": True, 46 | "login": self.rid, 47 | "isVod": False, 48 | "vodID": "", 49 | "playerType": "site" 50 | } 51 | } 52 | 53 | headers = { 54 | 'Client-ID': self.get_client_id(), 55 | 'Referer': 'https://www.twitch.tv/', 56 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 57 | 'Chrome/90.0.4430.93 Safari/537.36', 58 | } 59 | res = self.s.post('https://gql.twitch.tv/gql', headers=headers, data=json.dumps(data)).json() 60 | try: 61 | token, signature, _ = res['data']['streamPlaybackAccessToken'].values() 62 | except AttributeError: 63 | raise Exception("Channel does not exist") 64 | 65 | return signature, token 66 | 67 | def get_real_url(self): 68 | signature, token = self.get_sig_token() 69 | params = { 70 | 'allow_source': 'true', 71 | 'dt': 2, 72 | 'fast_bread': 'true', 73 | 'player_backend': 'mediaplayer', 74 | 'playlist_include_framerate': 'true', 75 | 'reassignments_supported': 'true', 76 | 'sig': signature, 77 | 'supported_codecs': 'vp09,avc1', 78 | 'token': token, 79 | 'cdm': 'wv', 80 | 'player_version': '1.4.0', 81 | } 82 | url = f'https://usher.ttvnw.net/api/channel/hls/{self.rid}.m3u8?{urlencode(params)}' 83 | return url 84 | 85 | 86 | if __name__ == '__main__': 87 | r = input('请输入 twitch 房间名:\n') 88 | print(Twitch(r).get_real_url()) 89 | -------------------------------------------------------------------------------- /scripts/lives/v6cn.py: -------------------------------------------------------------------------------- 1 | # 获取六间房直播的真实流媒体地址。 2 | 3 | import re 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class V6CN(Base): 11 | _name = '六间房' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | try: 19 | response = requests.get('https://v.6.cn/' + str(self.rid)).text 20 | result = re.findall(r'"flvtitle":"v(\d*?)-(\d*?)"', response)[0] 21 | uid = result[0] 22 | flvtitle = 'v{}-{}'.format(*result) 23 | response = requests.get('https://rio.6rooms.com/live/?s=' + str(uid)).text 24 | hip = 'https://' + re.findall(r'(.*\.xiu123\.cn).*', response)[0] 25 | real_url = [hip + '/' + flvtitle + '/playlist.m3u8', hip + '/httpflv/' + flvtitle] 26 | except: 27 | return '直播间不存在或未开播' 28 | return real_url 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('请输入六间房直播房间号:\n') 33 | print(V6CN(r).get_real_url()) 34 | -------------------------------------------------------------------------------- /scripts/lives/wali.py: -------------------------------------------------------------------------------- 1 | # 小米直播:https://live.wali.com/fe 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class WaLi(Base): 9 | _name = '小米' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | zuid = self.rid.split('_')[0] 17 | with requests.Session() as s: 18 | res = s.get('https://s.zb.mi.com/get_liveinfo?lid={}&zuid={}'.format(self.rid, zuid)).json() 19 | status = res['data']['status'] 20 | if status == 1: 21 | flv = res['data']['video']['flv'] 22 | return flv.replace('http', 'https') 23 | else: 24 | return '直播间不存在或未开播' 25 | 26 | 27 | if __name__ == '__main__': 28 | r = input('请输入小米直播房间号:\n') 29 | print(WaLi(r).get_real_url()) 30 | -------------------------------------------------------------------------------- /scripts/lives/woxiu.py: -------------------------------------------------------------------------------- 1 | # 我秀直播:https://www.woxiu.com/ 2 | 3 | import requests 4 | 5 | from scripts.base import Base 6 | 7 | 8 | class WoXiu(Base): 9 | _name = '我秀' 10 | 11 | def __init__(self, rid): 12 | super(Base, self).__init__() 13 | self.rid = rid 14 | 15 | def get_real_url(self): 16 | headers = { 17 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) ' 18 | 'Version/11.0 Mobile/15A372 Safari/604.1' 19 | } 20 | url = 'https://m.woxiu.com/index.php?action=M/Live&do=LiveInfo&room_id={}'.format(self.rid) 21 | with requests.Session() as s: 22 | res = s.get(url, headers=headers) 23 | try: 24 | res = res.json() 25 | except: 26 | return '直播间不存在' 27 | status = res['online'] 28 | if status: 29 | live_stream = res['live_stream'] 30 | return live_stream 31 | else: 32 | return '未开播' 33 | 34 | 35 | if __name__ == '__main__': 36 | r = input('请输入我秀直播房间号:\n') 37 | print(WoXiu(r).get_real_url()) 38 | -------------------------------------------------------------------------------- /scripts/lives/xunlei.py: -------------------------------------------------------------------------------- 1 | # 迅雷直播:https://live.xunlei.com/global/index.html?id=0 2 | 3 | import requests 4 | import hashlib 5 | import time 6 | from urllib.parse import urlencode 7 | 8 | from scripts.base import Base 9 | 10 | 11 | class XunLei(Base): 12 | _name = '迅雷' 13 | 14 | def __init__(self, rid): 15 | super(Base, self).__init__() 16 | self.rid = rid 17 | 18 | def get_real_url(self): 19 | url = 'https://biz-live-ssl.xunlei.com//caller' 20 | headers = { 21 | 'cookie': 'appid=1002' 22 | } 23 | _t = int(time.time() * 1000) 24 | u = '1002' 25 | f = '&*%$7987321GKwq' 26 | params = { 27 | '_t': _t, 28 | 'a': 'play', 29 | 'c': 'room', 30 | 'hid': 'h5-e70560ea31cc17099395c15595bdcaa1', 31 | 'uuid': self.rid, 32 | } 33 | data = urlencode(params) 34 | p = hashlib.md5((u + data + f).encode('utf-8')).hexdigest() 35 | params['sign'] = p 36 | with requests.Session() as s: 37 | res = s.get(url, params=params, headers=headers).json() 38 | if res['result'] == 0: 39 | play_status = res['data']['play_status'] 40 | if play_status == 1: 41 | real_url = res['data']['data']['stream_pull_https'] 42 | return real_url 43 | else: 44 | return '未开播' 45 | else: 46 | return '直播间可能不存在' 47 | 48 | 49 | if __name__ == '__main__': 50 | r = input('请输入迅雷直播房间号:\n') 51 | print(XunLei(r).get_real_url()) 52 | 53 | -------------------------------------------------------------------------------- /scripts/lives/yangshipin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/3 12:28 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | # CCTV-1: https://m.yangshipin.cn/video?type=1&vid=2000210103&pid=600001859 8 | # 需要替换 headers 中登陆的 cookie 9 | # 目前网页版链接有效时间很短,且每个IP每天的请求数量有限制 10 | # APP版本的链接放时间更长,但需要反编译获取ckey生成方式,以后再更新。 11 | 12 | import binascii 13 | import ctypes 14 | import time 15 | import uuid 16 | from urllib.parse import parse_qs 17 | 18 | import requests 19 | from Crypto.Cipher import AES 20 | 21 | from scripts.base import Base 22 | 23 | 24 | def aes_encrypt(text): 25 | """ 26 | AES加密 27 | """ 28 | key = binascii.a2b_hex('4E2918885FD98109869D14E0231A0BF4') 29 | iv = binascii.a2b_hex('16B17E519DDD0CE5B79D7A63A4DD801C') 30 | pad = 16 - len(text) % 16 31 | text = text + pad * chr(pad) 32 | text = text.encode() 33 | cipher = AES.new(key, AES.MODE_CBC, iv) 34 | encrypt_bytes = cipher.encrypt(text) 35 | return binascii.b2a_hex(encrypt_bytes).decode() 36 | 37 | 38 | class YangShiPin(Base): 39 | _name = '央视频' 40 | 41 | def __init__(self, rid): 42 | super(Base, self).__init__() 43 | self.rid = rid 44 | 45 | 46 | def get_real_url(self): 47 | var = parse_qs(self.rid) 48 | vid, = var['vid'] 49 | pid, = var['pid'] 50 | 51 | platform = 4330701 52 | guid = 'ko7djb70_vbjvrg5gcm' 53 | txvlive_version = '3.0.37' 54 | tt = int(time.time()) 55 | jc = 'mg3c3b04ba' 56 | wu = f'|{vid}|{tt}|{jc}|{txvlive_version}|{guid}|{platform}|https://m.yangshipin.cn/|mozilla/5.0 (iphone; ' \ 57 | f'cpu||Mozilla|Netscape|Win32| ' 58 | 59 | u = 0 60 | for i in wu: 61 | _char = ord(i) 62 | u = (u << 5) - u + _char 63 | u &= u & 0xffffffff 64 | bu = ctypes.c_int32(u).value 65 | 66 | xu = f'|{bu}{wu}' 67 | # ckey是个aes加密,CBC模式,pkcs7填充 68 | ckey = ('--01' + aes_encrypt(xu)).upper() 69 | 70 | self.params = { 71 | 'cmd': 2, 72 | 'cnlid': vid, 73 | 'pla': 0, 74 | 'stream': 2, 75 | 'system': 1, 76 | 'appVer': '3.0.37', 77 | 'encryptVer': '8.1', 78 | 'qq': 0, 79 | 'device': 'PC', 80 | 'guid': 'ko7djb70_vbjvrg5gcm', 81 | 'defn': 'auto', 82 | 'host': 'yangshipin.cn', 83 | 'livepid': pid, 84 | 'logintype': 1, 85 | 'vip_status': 1, 86 | 'livequeue': 1, 87 | 'fntick': tt, 88 | 'tm': tt, 89 | 'sdtfrom': 113, 90 | 'platform': platform, 91 | 'cKey': ckey, 92 | 'queueStatus': 0, 93 | 'uhd_flag': 4, 94 | 'flowid': uuid.uuid4().hex, 95 | 'sphttps': 1, 96 | # 'callback': 'txvlive_videoinfoget_9046016361', 97 | } 98 | headers = { 99 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, ' 100 | 'like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1', 101 | 'referer': 'https://m.yangshipin.cn/', 102 | 'cookie': '' 103 | } 104 | res = requests.get('https://liveinfo.yangshipin.cn/', headers=headers, params=self.params).json() 105 | url = res.get('playurl', 0) 106 | if url: 107 | return url 108 | else: 109 | return res 110 | 111 | 112 | if __name__ == '__main__': 113 | r = input('显示“无登录信息”,则需要填充cookie。请输入央视频地址:\n') 114 | print(YangShiPin(r).get_real_url()) 115 | -------------------------------------------------------------------------------- /scripts/lives/yizhibo.py: -------------------------------------------------------------------------------- 1 | # 获取一直播的真实流媒体地址。 2 | 3 | import re 4 | 5 | import requests 6 | 7 | from scripts.base import Base 8 | 9 | 10 | class YiZhiBo(Base): 11 | _name = '一直播' 12 | 13 | def __init__(self, rid): 14 | super(Base, self).__init__() 15 | self.rid = rid 16 | 17 | def get_real_url(self): 18 | try: 19 | scid = re.findall(r'/l/(\S*).html', self.rid)[0] 20 | flvurl = 'http://alcdn.f01.xiaoka.tv/live/{}.flv'.format(scid) 21 | m3u8url = 'http://al01.alcdn.hls.xiaoka.tv/live/{}.m3u8'.format(scid) 22 | rtmpurl = 'rtmp://alcdn.r01.xiaoka.tv/live/live/{}'.format(scid) 23 | real_url = { 24 | 'flvurl': flvurl, 25 | 'm3u8url': m3u8url, 26 | 'rtmpurl': rtmpurl 27 | } 28 | except: 29 | return '链接错误' 30 | return real_url 31 | 32 | def get_status(self): 33 | try: 34 | scid = re.findall(r'/l/(\S*).html', self.rid)[0] 35 | response = requests.get( 36 | url='https://m.yizhibo.com/www/live/get_live_video?scid=' + str(scid)).json() 37 | status_code = response.get('data').get('info').get('status') 38 | status = '直播中' if status_code == 10 else '未开播' 39 | except: 40 | raise Exception('链接错误') 41 | return status 42 | 43 | 44 | if __name__ == '__main__': 45 | r = input('请输入一直播房间地址:\n') 46 | print(YiZhiBo(r).get_real_url()) 47 | -------------------------------------------------------------------------------- /scripts/lives/youku.py: -------------------------------------------------------------------------------- 1 | # 获取@优酷轮播台@的真实流媒体地址。 2 | # 优酷轮播台是优酷直播live.youku.com下的一个子栏目,轮播一些经典电影电视剧,个人感觉要比其他直播平台影视区的画质要好, 3 | # 而且没有平台水印和主播自己贴的乱七八糟的字幕遮挡。 4 | # liveId 是如下形式直播间链接: 5 | # “https://vku.youku.com/live/ilproom?spm=a2hcb.20025885.m_16249_c_59932.d_11&id=8019610&scm=20140670.rcmd.16249.live_8019610”中的8019610字段。 6 | 7 | import hashlib 8 | import json 9 | import time 10 | 11 | import requests 12 | 13 | from scripts.base import Base 14 | 15 | 16 | class YouKu(Base): 17 | _name = '优酷轮播台' 18 | 19 | def __init__(self, rid): 20 | super(Base, self).__init__() 21 | self.rid = rid 22 | 23 | def get_real_url(self): 24 | try: 25 | tt = str(int(time.time() * 1000)) 26 | data = json.dumps({'liveId': self.rid, 'app': 'Pc'}, separators=(',', ':')) 27 | url = 'https://acs.youku.com/h5/mtop.youku.live.com.livefullinfo/1.0/?appKey=24679788' 28 | s = requests.Session() 29 | cookies = s.get(url).cookies 30 | token = requests.utils.dict_from_cookiejar(cookies).get('_m_h5_tk')[0:32] 31 | sign = hashlib.md5((token + '&' + tt + '&' + '24679788' + '&' + data).encode('utf-8')).hexdigest() 32 | params = { 33 | 't': tt, 34 | 'sign': sign, 35 | 'data': data 36 | } 37 | response = s.get(url, params=params).json() 38 | # name = response.get('data').get('data').get('name') 39 | streamname = response.get('data').get('data').get('stream')[0].get('streamName') 40 | real_url = 'http://lvo-live.youku.com/vod2live/{}_mp4hd2v3.m3u8?&expire=21600&psid=1&ups_ts={}&vkey='.format( 41 | streamname, int(time.time())) 42 | except: 43 | return '请求错误' 44 | return real_url 45 | 46 | 47 | if __name__ == '__main__': 48 | r = input('请输入优酷轮播台房间号:\n') 49 | print(YouKu(r).get_real_url()) 50 | -------------------------------------------------------------------------------- /scripts/lives/yuanbobo.py: -------------------------------------------------------------------------------- 1 | # 热猫直播:https://zhibo.yuanbobo.com/ 2 | import re 3 | 4 | import requests 5 | 6 | from scripts.base import Base 7 | 8 | 9 | class YuanBoBo(Base): 10 | _name = '热猫' 11 | 12 | def __init__(self, rid): 13 | super(Base, self).__init__() 14 | self.rid = rid 15 | 16 | def get_real_url(self): 17 | with requests.Session() as s: 18 | res = s.get('https://zhibo.yuanbobo.com/' + str(self.rid)).text 19 | stream_id = re.search(r"stream_id:\s+'(\d+)'", res) 20 | if stream_id: 21 | status = re.search(r"status:\s+'(\d)'", res).group(1) 22 | if status == '1': 23 | real_url = 'http://ks-hlslive.yuanbobo.com/live/{}/index.m3u8'.format(stream_id.group(1)) 24 | return real_url 25 | else: 26 | return '未开播' 27 | else: 28 | return '直播间不存在' 29 | 30 | 31 | if __name__ == '__main__': 32 | r = input('输入热猫直播房间号:\n') 33 | print(YuanBoBo(r).get_real_url()) 34 | -------------------------------------------------------------------------------- /scripts/lives/yy.py: -------------------------------------------------------------------------------- 1 | # 获取YY直播的真实流媒体地址。https://www.yy.com/1349606469 2 | # 默认获取最高画质 3 | 4 | import json 5 | import re 6 | 7 | import requests 8 | 9 | from scripts.base import Base 10 | 11 | 12 | class YY(Base): 13 | _name = 'YY' 14 | 15 | def __init__(self, rid): 16 | super(Base, self).__init__() 17 | self.rid = rid 18 | 19 | def get_real_url(self): 20 | headers = { 21 | 'referer': 'http://wap.yy.com/mobileweb/{rid}'.format(rid=self.rid), 22 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko)' 23 | ' Version/11.0 Mobile/15A372 Safari/604.1' 24 | } 25 | room_url = 'http://interface.yy.com/hls/new/get/{rid}/{rid}/1200?source=wapyy&callback='.format(rid=self.rid) 26 | with requests.Session() as s: 27 | res = s.get(room_url, headers=headers) 28 | if res.status_code == 200: 29 | data = json.loads(res.text[1:-1]) 30 | if data.get('hls', 0): 31 | xa = data['audio'] 32 | xv = data['video'] 33 | xv = re.sub(r'_0_\d+_0', '_0_0_0', xv) 34 | url = 'https://interface.yy.com/hls/get/stream/15013/{}/15013/{}?source=h5player&type=m3u8'.format(xv, 35 | xa) 36 | res = s.get(url).json() 37 | real_url = res['hls'] 38 | return real_url 39 | else: 40 | return '未开播' 41 | else: 42 | return '直播间不存在' 43 | 44 | 45 | if __name__ == '__main__': 46 | r = input('输入YY直播房间号:\n') 47 | print(YY(r).get_real_url()) 48 | -------------------------------------------------------------------------------- /scripts/lives/zhanqi.py: -------------------------------------------------------------------------------- 1 | # 获取战旗直播(战旗TV)的真实流媒体地址。https://www.zhanqi.tv/lives 2 | # 默认最高画质 3 | 4 | import json 5 | 6 | import requests 7 | 8 | from scripts.base import Base 9 | 10 | 11 | class ZhanQi(Base): 12 | _name = '战旗' 13 | 14 | def __init__(self, rid): 15 | super(Base, self).__init__() 16 | self.rid = rid 17 | self.s = requests.Session() 18 | 19 | def get_real_url(self): 20 | 21 | res = self.s.get('https://m.zhanqi.tv/api/static/v2.1/room/domain/{}.json'.format(self.rid)) 22 | try: 23 | res = res.json() 24 | videoid = res['data']['videoId'] 25 | status = res['data']['status'] 26 | except (KeyError, json.decoder.JSONDecodeError): 27 | return 'Incorrect rid' 28 | 29 | if status == '4': 30 | # 获取gid 31 | res = self.s.get('https://www.zhanqi.tv/api/public/room.viewer') 32 | try: 33 | res = res.json() 34 | gid = res['data']['gid'] 35 | except KeyError: 36 | return 'Getting gid incorrectly' 37 | 38 | # 获取cdn_host 39 | res = self.s.get('https://umc.danuoyi.alicdn.com/dns_resolve_https?app=zqlive&host_key=alhdl-cdn.zhanqi.tv') 40 | cdn_host, *_ = res.json().get('redirect_domain') 41 | 42 | # 获取chain_key 43 | data = { 44 | 'stream': f'{videoid}.flv', 45 | 'cdnKey': 202, 46 | 'platform': 128, 47 | } 48 | headers = { 49 | 'cookie': f'gid={gid}', 50 | } 51 | res = self.s.post('https://www.zhanqi.tv/api/public/burglar/chain', data=data, headers=headers).json() 52 | chain_key = res['data']['key'] 53 | url = f'https://{cdn_host}/alhdl-cdn.zhanqi.tv/zqlive/{videoid}.flv?{chain_key}&playNum=68072487067' \ 54 | f'&gId={gid}&ipFrom=1&clientIp=&fhost=h5&platform=128 ' 55 | 56 | return url 57 | else: 58 | return 'No streaming' 59 | 60 | 61 | if __name__ == '__main__': 62 | r = input('输入战旗直播房间号:\n') 63 | print(ZhanQi(r).get_real_url()) 64 | -------------------------------------------------------------------------------- /scripts/lives/zhibotv.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Time: 2021/5/13 20:27 3 | # @Project: real-url 4 | # @Author: wbt5 5 | # @Blog: https://wbt5.com 6 | 7 | import requests 8 | 9 | from scripts.base import Base 10 | 11 | 12 | class ZhiBotv(Base): 13 | _name = '中国体育' 14 | 15 | def __init__(self, rid): 16 | super(Base, self).__init__() 17 | self.rid = rid 18 | self.params = { 19 | 20 | 'token': '', 21 | 'roomId': self.rid, 22 | 'angleId': '', 23 | 'lineId': '', 24 | 'definition': 'hd', 25 | 'statistics': 'pc|web|1.0.0|0|0|0|local|5.0.1', 26 | 27 | } 28 | 29 | def get_real_url(self): 30 | """ 31 | no streaming 没开播; 32 | non-existent rid 房间号不存在; 33 | :return: url 34 | """ 35 | with requests.Session() as s: 36 | res = s.get('https://rest.zhibo.tv/room/get-pull-stream-info-v430', params=self.params).json() 37 | if 'hlsHUrl' in res['data']: 38 | url = res['data'].get('hlsHUrl') 39 | if url: 40 | return url 41 | else: 42 | return 'no streaming' 43 | else: 44 | return 'non-existent rid' 45 | 46 | 47 | if __name__ == '__main__': 48 | r = input('请输入中国体育房间号:\n') 49 | print(ZhiBotv(r).get_real_url()) 50 | -------------------------------------------------------------------------------- /templates/LiveUrlDocs.html: -------------------------------------------------------------------------------- 1 | 2 | LiveUrlDocs 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 261 | 262 | 263 |
264 |

直播流地址获取接口文档

265 | 266 |

请求地址

267 | 268 |

http://api.pyduck.com/live-api/get-url

269 |

请求方法

270 | 271 |

GET

272 |

参数

273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 |
字段名是否必须说明
live_platform平台名称
parameter房间号或者分享连接
295 |

响应体

296 | 297 |

成功响应

298 |
{
299 |     "data": "未开播",
300 |     "state": 1
301 | }
302 | 
{
303 |     "data": "http://hls.2cq.com/liverepeater/933440/playlist.m3u8",
304 |     "state": 1
305 | }
306 | 

失败响应

307 |
{
308 |     "data": null,
309 |     "state": 0
310 | }
311 | 

平台字段说明

312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 |
平台名称请求说明
棉花糖直播房间号
九秀直播房间号
17直播房间号
羚萌直播房间号
95秀直播房间号
艺气山直播房间号
AcFun直播房间号
哔哩哔哩直播房间号
网易CC直播房间号
畅秀阁直播房间号
抖音抖音直播间room_id或分享链接
斗鱼直播间号
企鹅电竞房间号
新浪疯播直播房间号
红人直播房间号
花椒直播房间号
火猫直播房间号
虎牙直播房间号
艾米直播房间号
陌陌直播房间号
映客直播房间号
爱奇艺直播房间号
西瓜直播房间号
京东直播房间号
腾讯体育直播间地址
KK直播房间号
快手直播房间ID
酷狗直播房间号
酷我聚星直播房间号
来疯直播房间号
乐嗨直播房间号
龙珠直播房间号
Look直播房间号
猫耳直播房间号
NOW直播间号
PPS奇秀直播房间号
PP体育直播间地址
千帆直播房间号
企鹅体育直播房间号
人人直播房间号
秀色直播房间号
爱奇艺体育直播间完整地址
TikTok分享链接
星光直播房间号
twitch房间名
六间房直播房间号
小米直播房间号
我秀直播房间号
迅雷直播房间号
央视频央视频地址
一直播房间地址
优酷轮播台房间号
热猫直播房间号
YY直播房间号
战旗直播房间号
中国体育房间号
bigo直播房间号
liveu直播房间号
咪咕直播间房间号
559 | 560 |
561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | -------------------------------------------------------------------------------- /templates/LiveUrlDocs.md: -------------------------------------------------------------------------------- 1 | ## 直播流地址获取接口文档 2 | 3 | ### 请求地址 4 | 5 | http://api.pyduck.com/live-api/get-url 6 | 7 | ### 请求方法 8 | 9 | GET 10 | 11 | ### 参数 12 | 13 | 字段名|是否必须|说明 14 | -|-|- 15 | live_platform|是|平台名称 16 | parameter|是|房间号或者分享连接 17 | 18 | ### 响应体 19 | 20 | 成功响应 21 | 22 | ```json 23 | { 24 | "data": "未开播", 25 | "state": 1 26 | } 27 | ``` 28 | 29 | ```json 30 | { 31 | "data": "http://hls.2cq.com/liverepeater/933440/playlist.m3u8", 32 | "state": 1 33 | } 34 | ``` 35 | 36 | 失败响应 37 | 38 | ```json 39 | { 40 | "data": null, 41 | "state": 0 42 | } 43 | ``` 44 | 45 | ### 平台字段说明 46 | 47 | 平台名称|请求说明 48 | -|- 49 | 棉花糖|直播房间号 50 | 九秀|直播房间号 51 | 17|直播房间号 52 | 羚萌|直播房间号 53 | 95秀|直播房间号 54 | 艺气山|直播房间号 55 | AcFun|直播房间号 56 | 哔哩哔哩|直播房间号 57 | 网易CC|直播房间号 58 | 畅秀阁|直播房间号 59 | 抖音|抖音直播间room_id或分享链接 60 | 斗鱼|直播间号 61 | 企鹅电竞|房间号 62 | 新浪疯播|直播房间号 63 | 红人|直播房间号 64 | 花椒|直播房间号 65 | 火猫|直播房间号 66 | 虎牙|直播房间号 67 | 艾米|直播房间号 68 | 陌陌|直播房间号 69 | 映客|直播房间号 70 | 爱奇艺|直播房间号 71 | 西瓜|直播房间号 72 | 京东|直播房间号 73 | 腾讯体育|直播间地址 74 | KK|直播房间号 75 | 快手|直播房间ID 76 | 酷狗|直播房间号 77 | 酷我聚星|直播房间号 78 | 来疯|直播房间号 79 | 乐嗨|直播房间号 80 | 龙珠|直播房间号 81 | Look|直播房间号 82 | 猫耳|直播房间号 83 | NOW|直播间号 84 | PPS奇秀|直播房间号 85 | PP体育|直播间地址 86 | 千帆|直播房间号 87 | 企鹅体育|直播房间号 88 | 人人|直播房间号 89 | 秀色|直播房间号 90 | 爱奇艺体育|直播间完整地址 91 | TikTok|分享链接 92 | 星光|直播房间号 93 | twitch|房间名 94 | 六间房|直播房间号 95 | 小米|直播房间号 96 | 我秀|直播房间号 97 | 迅雷|直播房间号 98 | 央视频|央视频地址 99 | 一直播|房间地址 100 | 优酷轮播台|房间号 101 | 热猫|直播房间号 102 | YY|直播房间号 103 | 战旗|直播房间号 104 | 中国|体育房间号 105 | bigo|直播房间号 106 | liveu|直播房间号 107 | 咪咕|直播间房间号 --------------------------------------------------------------------------------