GithubHelp home page GithubHelp logo

Comments (4)

SocialSisterYi avatar SocialSisterYi commented on July 28, 2024

请在文件cxapi/jobs/video.py的71行html = BeautifulSoup(resp.text, 'lxml') 下方添加print(html)输出card页的html源码检查内嵌js代码是否存在对window.AttachmentSetting的赋值语句

from cxkitty.

RigoLigoRLC avatar RigoLigoRLC commented on July 28, 2024

我的一个课开始的部分章节没有开放,出现了相同的错误。页面源码为:

<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
name="viewport"/>
<title> 信息提示</title>
<link href="/css/tip.css?v=1.0.3" rel="stylesheet"/>
<script src="/static/js/domain.js" type="text/javascript"></script>
<script src="/js/phone/protocolChaoXing/CXJSBridge.js"></script>










</script>
</head>
<body>
<div class="ybox">
<p class="blankTips">章节未开放!</p>
</div>
</body>
</html>

from cxkitty.

RigoLigoRLC avatar RigoLigoRLC commented on July 28, 2024

为了刷课自己hack了一个能运行的,估计没什么参考价值

diff --git a/cxapi/jobs/video.py b/cxapi/jobs/video.py
index fbc8675..75f0804 100644
--- a/cxapi/jobs/video.py
+++ b/cxapi/jobs/video.py
@@ -86,6 +86,11 @@ class ChapterVideo:
         resp.raise_for_status()
         html = BeautifulSoup(resp.text, "lxml")
         try:
+            try:
+                if 'blankTips' in html.p['class']:
+                    return False
+            except Exception:
+                pass
             if r := re.search(
                 r"window\.AttachmentSetting *= *(.+?);",
                 html.head.find("script", type="text/javascript").text,

from cxkitty.

2563411574 avatar 2563411574 commented on July 28, 2024

为了刷课自己hack了一个能运行的,估计没什么参考价值

diff --git a/cxapi/jobs/video.py b/cxapi/jobs/video.py
index fbc8675..75f0804 100644
--- a/cxapi/jobs/video.py
+++ b/cxapi/jobs/video.py
@@ -86,6 +86,11 @@ class ChapterVideo:
         resp.raise_for_status()
         html = BeautifulSoup(resp.text, "lxml")
         try:
+            try:
+                if 'blankTips' in html.p['class']:
+                    return False
+            except Exception:
+                pass
             if r := re.search(
                 r"window\.AttachmentSetting *= *(.+?);",
                 html.head.find("script", type="text/javascript").text,

大佬 这个要加在哪里呢

from cxkitty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.