当前位置: 首页 > news >正文

51个人网站做餐饮系统网站

51个人网站,做餐饮系统网站,17网站一起做网店普宁,软件项目管理pdf环境#xff1a;IOS想使用 换源阅读 问题#xff1a;换新手机#xff0c;源阅读下架后#xff0c;没有好的APP阅读小说 解决办法#xff1a;自签APP 转换源仓库书源 最终预览 #xff1a;https://rc.real9.cn/ 背景#xff1a;自从我换了新iPhone手机#xff0c;就无法… 环境IOS想使用 换源阅读 问题换新手机源阅读下架后没有好的APP阅读小说 解决办法自签APP 转换源仓库书源 最终预览 https://rc.real9.cn/ 背景自从我换了新iPhone手机就无法使换源阅读了于是我自用上结果发现现在的书源发展的很快旧版本的源阅读APP部分书源的语法不支持于是我反复总结对比写了一个自动转换的python程序如上链接 解决过程自签APP转换书源 文章目录 1.下载 ipa2.自签IPA3.转换书源3.1 获得书源3.2 转换规则3.3 转换书源 4.在线转换4.1 web版源代码4.2 我还写了个docker版本的 1.下载 ipa 下载地址我就不放了 2.自签IPA 关于怎么自签你们可以用轻松签、全能签小白啥也不会就算了 3.转换书源 3.1 获得书源 源仓库也不提供了自己搜 https://yuedu.miaogongzi.net/ 3.2 转换规则 由于这款APP版本是2021年左右的很多新版书源不支持我们要进行转换我自己花了点时间总结了一点转换规则 最常见的规则是不支持a.1text 这种要转换其他参考下列 书源类型 0 文本 2 视频 3 漫画 1 音频 ------------------------------- # 选择ID . 选择元素 class之类子元素 ~ 第二个兄弟元素同级关系 p:nth-child(2) 父元素的第n个子元素 [] 属性选择器 [class^book] 选择class以book开头的元素 ! 倒序选择器 img:!-1 选择最后一个img元素 || 列组合选择器 col||td 选择col和td元素( ) 分组选择器 (div,p) 选择所有div和p , 多个选择器 .item, .active 选择item和active类 * 通用元素选择器 *.item 选择所有类名包含item的元素 n 表达式选择器 li:nth-child(3n) 按序选择li元素每个li元素的父元素中的第 3、6、9、12等序号 a.-1text 改为a:nth-last-child(1)text a.1text a:nth-child(1)text### 3.3 步骤3.3 3.3 转换书源 现在开始转换笨的办法是用记事本替换我写了个python脚本来自动替换 import json import requestsdef replace_selectors(json_data):# 替换选择器的函数def replace_selector(selector):if . in selector and in selector:parts selector.split(.)tag parts[0]selector_part parts[1]if in selector_part:num, at_text selector_part.split(, 1)if : in num:num, tag_after_colon num.split(:, 1)num f{num}{tag_after_colon}if num.replace(-, ).replace(., ).isdigit():num 1 if num 0 else num # 处理小数点后面是0的情况if num.startswith(-):num num[1:]return f{tag}:nth-last-child({num}){at_text}else:return f{tag}:nth-child({num}){at_text}return selector# 处理列表类型的 JSON 数据if isinstance(json_data, list):for item in json_data:replace_selectors(item)return# 遍历字典类型的 JSON 数据查找并替换选择器for key, value in json_data.items():if isinstance(value, str):if in value:value replace_selector(value)json_data[key] valueelif isinstance(value, dict):replace_selectors(value)elif isinstance(value, list):for item in value:if isinstance(item, dict):replace_selectors(item)# 增加替换规则当ruleExplore: []时替换为ruleExplore: ##if ruleExplore in json_data and not json_data[ruleExplore]:json_data[ruleExplore] ##if __name__ __main__:# 用户输入 JSON 文件的 URLjson_url input(请输入 JSON 文件的 URL: )# 下载 JSON 数据response requests.get(json_url)json_data response.json()# 替换选择器replace_selectors(json_data)# 提取文件名并保存 JSON 内容到文件file_name json_url.split(/)[-1]with open(file_name, w, encodingutf-8) as file:json.dump(json_data, file, indent4, ensure_asciiFalse)print(fJSON 内容已按照新的替换原则进行替换并保存为文件{file_name}) 4.在线转换 本地转换有点麻烦我玩手机的时候电脑又不会一直在身边我就把上面的代码改成了web版本这些复制转换后的连接到APP剪贴板导入就好了效果如下 4.1 web版源代码 import json import os import requests from flask import Flask, render_template, request, send_from_directory, url_for from werkzeug.utils import secure_filenameapp Flask(__name__)def replace_selectors(json_data):# 替换选择器的函数def replace_selector(selector):if . in selector and in selector:parts selector.split(.)tag parts[0]selector_part parts[1]if in selector_part:num, at_text selector_part.split(, 1)if : in num:num, tag_after_colon num.split(:, 1)num f{num}{tag_after_colon}if num.replace(-, ).replace(., ).isdigit():num 1 if num 0 else num # 处理小数点后面是0的情况if num.startswith(-):num num[1:]return f{tag}:nth-last-child({num}){at_text}else:return f{tag}:nth-child({num}){at_text}return selector# 处理列表类型的 JSON 数据if isinstance(json_data, list):for item in json_data:replace_selectors(item)return# 遍历字典类型的 JSON 数据查找并替换选择器for key, value in json_data.items():if isinstance(value, str):if in value:value replace_selector(value)json_data[key] valueelif isinstance(value, dict):replace_selectors(value)elif isinstance(value, list):for item in value:if isinstance(item, dict):replace_selectors(item)# 增加替换规则当ruleExplore: []时替换为ruleExplore: ##if ruleExplore in json_data and not json_data[ruleExplore]:json_data[ruleExplore] ##if __name__ __main__:app.route(/, methods[GET, POST])def index():if request.method POST:json_url request.form[json_url]response requests.get(json_url)json_data response.json()replace_selectors(json_data)# 提取文件名并保存 JSON 内容到文件file_name json_url.split(/)[-1]json_dir os.path.join(os.path.dirname(__file__), json)if not os.path.exists(json_dir):os.makedirs(json_dir)json_path os.path.join(json_dir, file_name)with open(json_path, w, encodingutf-8) as file:json.dump(json_data, file, indent4, ensure_asciiFalse)# 生成下载链接download_link url_for(download, file_namefile_name)return render_template(result.html, json_datajson_data, download_linkdownload_link)return render_template(form.html)app.route(/json/path:file_name, methods[GET])def download(file_name):json_dir os.path.join(os.path.dirname(__file__), json)file_path os.path.join(json_dir, file_name)return send_from_directory(json_dir, file_name, as_attachmentTrue)app.run(host0.0.0.0, port5000, debugTrue) 4.2 我还写了个docker版本的 docker pull realwang/booksource_transios:latest docker run -d --name transios -p 5000:5000 booksource_transios # 使用python3环境作为基础镜像 FROM python:3# 设置工作目录 WORKDIR /app# 安装git用于从GitHub下载代码 #RUN apt-get update apt-get install -y git# 从GitHub下载代码 RUN git clone https://ghproxy.com/https://github.com/wangrui1573/booksource_transIOS.git /app# 切换到代码目录 WORKDIR /app# 安装python依赖 RUN pip install --no-cache-dir -r requirements.txt# 将容器5000端口映射到主机的5000端口 EXPOSE 5000# 启动Python应用程序 CMD [python, api/conv_book_web.py]# docker run -d -p 5000:5000 booksource_transios源代码https://github.com/wangrui1573/booksource_transIOS
http://wiki.neutronadmin.com/news/158685/

相关文章:

  • 企业汽车网站建设做铁艺需要什么网站
  • 房地产楼盘微信网站建设营销方案目前比较火的外贸产品
  • 廊坊免费网站建设模板抽奖网站建设
  • 提供虚拟主机服务的网站厦门市住房和城乡建设局网站
  • 深圳网站建设php百度营销登录平台
  • 网站建设基本流程详细说明个人网站如何在百度上做推广
  • 抚州营销型网站建设一级a做网站免费
  • VIP视频自助网站建设青岛做网站费用
  • 广西住房和建设厅网站wordpress 传到哪里去
  • 网站开发非常之旅:ajax从入门到精通 pdf广告
  • 网站建设是属于虚拟产品吗网页设计与制作网站教程
  • 静态网站开发课程模板wordpress自动升级失败
  • 深圳网站建设要多少钱ftp怎么上传网站
  • 一个ip可以做几个网站织梦开发网站
  • 全flash网站八大营销方式有哪几种
  • 河南生产型企业网站建设个人网页制作教程代码
  • 网站建设需求分析文档网站怎样排版
  • 网站推广广告词大全集湖南省建设厅网站
  • 阿里巴巴上怎样做自己的网站成都百度推广公司电话
  • 网站备案号 脱离服务商如何下载别人网站模板
  • 商城网站主要内容关于加强教体局网站建设
  • 教育网站官网入口做网站多少钱啊
  • 山东系统建站怎么用英文外贸网站建设推广
  • 一个网站可以同时几个主域名吗郑州找人公司
  • 大连网站建设酷网科技网站建设排名公司
  • 四川住房建设厅网站首页中国最新战备状态
  • 横山专业做网站建设的公司wordpress返回404
  • 网站设计项目计划书深圳尼高品牌设计
  • 新昌网站制作com都有哪些网站
  • 做网站特别注意什么网站服务器ip地址在哪里看