优雅草采集器系统全面开源-优雅草YYC采集器系统不同版本的合集整体开源yyc-gather-采集器开源-优雅草央千澈

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
播放器SDK+视频点播VOD组合试用套餐,播放器+流量+转码 1个月
简介: 优雅草采集器系统全面开源-优雅草YYC采集器系统不同版本的合集整体开源yyc-gather-采集器开源-优雅草央千澈

优雅草采集器系统全面开源-优雅草YYC采集器系统不同版本的合集整体开源yyc-gather-采集器开源-优雅草央千澈

2025年1月5日yyc采集器将会不断的完善,本产品目前全面开源,会不断增加各种不同形式的采集器软件,我们把文件夹目录分了n个,后续都会直接分目录即可,不单独建立不同的采集器库,懒得麻烦了,采集数据可能会涉及多种法律问题,具体取决于数据的类型、采集方式、用途等诸多因素,请一定要在法律允许的范围内使用,否则后果自负。

源代码开源

开源下载地址:

https://gitee.com/youyacao/yyc-gather

2019年最初松鼠视频python-优雅草采集器

文件目录名:2019songshu

当年这个采集器做试验采集目标是以dy来采集的,可以采集到很多视频,当年只是测试了音乐和舞蹈分类。

量子蜘蛛-优雅草采集器

文件名目录名: liangzi

爬取量子资源网数据
dbconf.py是数据库配置
myclass_back.json是分类原始数据 在这里查看需要采集的分类,复制分类到  myclass.py中进行采集
安装好requirements.txt中的第三方包后就可以开始用命令开始采集
采集命令:scrapy  crawl liangzi

myclass.py是需要爬取的分类树,这里可以控制爬取的分类

量子蜘蛛优雅草采集器 主要是为了给雪花版提供的,这里包含了采集演员大数据的问题,还有一些其它影视评分相关内容,当年我们采集了接近50万条内容做测试。

相对内容更丰富:

vod_id = scrapy.Field()
    vod_name = scrapy.Field()
    vod_sub = scrapy.Field()
    type_id = scrapy.Field()
    super_type_id = scrapy.Field()
    type_name = scrapy.Field()
    vod_time = scrapy.Field()
    vod_remarks = scrapy.Field()
    vod_play_from = scrapy.Field()
    vod_pic = scrapy.Field() # 封面
    vod_play_url = scrapy.Field() # 播放地址
    vod_down_url = scrapy.Field() # 下载地址
    vod_actor = scrapy.Field() # 演员
    vod_director = scrapy.Field() # 导演
    vod_blurb = scrapy.Field() # 简介
    vod_area = scrapy.Field() # 国家
    vod_pubdate = scrapy.Field() # 上映时间
    vod_score = scrapy.Field() # 豆瓣评分
    vod_lang = scrapy.Field() # 语言
    vod_year = scrapy.Field() # 年份

pipelines.py 文件预览

复制class LiangziSpridePipeline:
    def __init__(self):
        self.wb = openpyxl.Workbook()
        self.ws = self.wb.active
        self.ws.title = 'Video'
        self.ws.append(('已更新集数(数字)', '是否已完结(1:0)', '分类ID(字典管理可查)', '题材ID(字典管理可查)',
                        '地区/国家ID', '年份ID(字典管理可查)', '标题', '副标题', '介绍', '时长',
                        '评分(数字)', '上映时间', '演员表', '查看次数(数字)', '点赞次数(数字)', '分享次数(数字)',
                        '收藏次数(数字)', '关联ID', '导演', '语言', '状态(0:删除1:待审核2:审核通过)',
                        '采集锁定(0:否1:是)'))
    def close_spider(self, spider):
        self.wb.save('体育视频.xlsx')
    def process_item(self, item, spider):
        vod_id = item.get('vod_id', '')
        vod_name = item.get('vod_name', '')
        type_id = item.get('type_id', '')
        super_type_id = item.get('super_type_id', '')
        type_name = item.get('type_name', '')
        vod_sub = item.get('vod_sub', '')
        vod_time = item.get('vod_time', '')
        vod_remarks = item.get('vod_remarks', '')
        vod_play_from = item.get('vod_play_from', '')
        vod_pic = item.get('vod_pic', '')  # 封面
        vod_play_url = item.get('vod_play_url', '')  # 播放地址
        vod_down_url = item.get('vod_down_url', '')  # 下载地址
        vod_actor = item.get('vod_actor', '')  # 演员
        vod_director = item.get('vod_director', '')  # 导演
        vod_blurb = item.get('vod_blurb', '')  # 简介
        vod_area = item.get('vod_area', '')  # 国家
        vod_score = item.get('vod_score', '')  # 评分
        vod_pubdate = item.get('vod_pubdate', '')  # 上映时间
        vod_lang = item.get('vod_lang', '')  # 语言
        vod_year = item.get('vod_year', '')  # 年份
        if type_id == 40:
            self.ws.append(
                (vod_remarks, '是否已完结', type_id, '题材ID', vod_area, vod_year, vod_name, vod_sub, vod_blurb,
                 '时长', vod_score, vod_pubdate, vod_actor, '查看次数', '点赞次数', '分享次数', '收藏次数',
                 super_type_id, vod_director, vod_lang, 1, 1))
        return item
class hanjuSpridePipeline:
    def __init__(self):
        self.wb = openpyxl.Workbook()
        self.ws = self.wb.active
        self.ws.title = 'Video'
        self.ws.append(('已更新集数(数字)', '是否已完结(1:0)', '分类ID(字典管理可查)', '题材ID(字典管理可查)',
                        '地区/国家ID', '年份ID(字典管理可查)', '标题', '副标题', '介绍', '时长',
                        '评分(数字)', '上映时间', '演员表', '查看次数(数字)', '点赞次数(数字)', '分享次数(数字)',
                        '收藏次数(数字)', '关联ID', '导演', '语言', '状态(0:删除1:待审核2:审核通过)',
                        '采集锁定(0:否1:是)'))
    def close_spider(self, spider):
        self.wb.save('韩剧视频.xlsx')
    def process_item(self, item, spider):
        # vod_id = item.get('vod_id', '')
        vod_name = item.get('vod_name', '')
        type_id = item.get('type_id', '')
        super_type_id = item.get('super_type_id', '')
        type_name = item.get('type_name', '')
        vod_sub = item.get('vod_sub', '')
        vod_time = item.get('vod_time', '')
        vod_remarks = item.get('vod_remarks', '')
        vod_play_from = item.get('vod_play_from', '')
        vod_pic = item.get('vod_pic', '')  # 封面
        vod_play_url = item.get('vod_play_url', '')  # 播放地址
        vod_down_url = item.get('vod_down_url', '')  # 下载地址
        vod_actor = item.get('vod_actor', '')  # 演员
        vod_director = item.get('vod_director', '')  # 导演
        vod_blurb = item.get('vod_blurb', '')  # 简介
        vod_area = item.get('vod_area', '')  # 国家
        vod_score = item.get('vod_score', '')  # 评分
        vod_pubdate = item.get('vod_pubdate', '')  # 上映时间
        vod_lang = item.get('vod_lang', '')  # 语言
        vod_year = item.get('vod_year', '')  # 年份
        if type_id == 15:
            self.ws.append(
                (vod_remarks, '是否已完结', type_id, '题材ID', vod_area, vod_year, vod_name, vod_sub, vod_blurb,
                 '时长', vod_score, vod_pubdate, vod_actor, '查看次数', '点赞次数', '分享次数', '收藏次数',
                 super_type_id, vod_director, vod_lang, 1, 1))
        return item
class MySqlSpridePipeline:
    def __init__(self):
        self.mysqlsession = None
        self.video_type_dy = [6, 7, 8, 9, 10, 11, 12, 20, 34, 45]
        self.video_type_esps = [13, 14, 15, 16, 21, 22, 23, 24, 46]
    def open_spider(self, spider):
        engine = create_engine('mysql+pymysql://'+dbconf.get('user')+':'+dbconf.get('password')+'@'+dbconf.get('host')+ '/'+dbconf.get('database')+'')
        Base.metadata.create_all(engine)
        # 创建 SQLAlchemy 会话对象
        Session = sessionmaker(bind=engine)
        self.mysqlsession = Session()
    def close_spider(self, spider):
        self.mysqlsession.close()
    def process_item(self, item, spider):
        # vod_id = item.get('vod_id', '')
        vod_name = item.get('vod_name', '')
        type_id = item.get('type_id', '')
        super_type_id = item.get('super_type_id', '')
        type_name = item.get('type_name', '')
        vod_sub = item.get('vod_sub', '')
        vod_time = item.get('vod_time', '')
        vod_remarks = item.get('vod_remarks', '')
        vod_play_from = item.get('vod_play_from', '')
        vod_pic = item.get('vod_pic', '')  # 封面
        vod_play_url = item.get('vod_play_url', '')  # 播放地址
        vod_down_url = item.get('vod_down_url', '')  # 下载地址
        vod_actor = item.get('vod_actor', '')  # 演员
        vod_director = item.get('vod_director', '')  # 导演
        vod_blurb = item.get('vod_blurb', '')  # 简介
        vod_area = item.get('vod_area', '')  # 国家
        vod_score = item.get('vod_score', '')  # 评分
        vod_pubdate = item.get('vod_pubdate', '')  # 上映时间
        vod_lang = item.get('vod_lang', '')  # 语言
        vod_year = item.get('vod_year', '')  # 年份
        movie_data = self.mysqlsession.query(Movie).filter(Movie.title.like("%" + vod_name + "%")).first()
        if movie_data is not None:  # Movie数据查到了
            if not movie_data.details:
                parts = vod_play_url.split('$$$')
                urls_list = []
                exp_list = []
                for part in parts:
                    exp = [x.split('$')[0] for x in part.split('#')]
                    urls = [(x.split('$')[1]).replace("\\", "") for x in part.split('#')]
                    exp_list.append(exp)  # 集数
                    urls_list.append({exp[i]: urls[i] for i in range(len(exp))})  # url地址
                parts = vod_play_url.split('$$$')
                urls_list = []
                for part in parts:
                    urls = [x.split('$')[1].replace("\\", "") for x in part.split('#')]
                    exp = [x.split('$')[0] for x in part.split('#')]
                    urls_list.append({exp[i]: urls[i] for i in range(len(exp))})
                for tt in urls_list[0]:
                    number_part = re.search(r'\d+', tt).group()
                    number = int(number_part)  # 纯数字集数   带文字的  直接用tt
                    details_filter = {
                        'movie_id': movie_data.id,
                        'title': vod_name + tt,
                        'url': urls_list[0][tt],
                        'sort': number,
                        'is_free': 1,
                    }
                    new_data1 = MovieDetail(**details_filter)
                    self.mysqlsession.add(new_data1)
        else:  # Movie数据没有查到
            query_filter = {'category_id': type_id, 'region': vod_area, 'year': vod_year, 'title': vod_name,
                            'subtitle': vod_sub,
                            'intro': vod_blurb, 'score': vod_score, 'release_date': vod_pubdate, 'thumb': vod_pic,
                            'actor_list': vod_actor, 'relate_id': super_type_id, 'status': 1,
                            'director': vod_director, 'language': vod_lang, 'type': 3}
            if type_id in self.video_type_dy:
                query_filter['type'] = 1
            if type_id in self.video_type_esps:
                query_filter['type'] = 2
            parts = vod_play_url.split('$$$')
            urls_list = []
            exp_list = []
            for part in parts:
                exp = [x.split('$')[0] for x in part.split('#')]
                urls = [(x.split('$')[1]).replace("\\", "") for x in part.split('#')]
                exp_list.append(exp)  # 集数
                urls_list.append({exp[i]: urls[i] for i in range(len(exp))})  # url地址
            parts = vod_play_url.split('$$$')
            urls_list = []
            for part in parts:
                urls = [x.split('$')[1].replace("\\", "") for x in part.split('#')]
                exp = [x.split('$')[0] for x in part.split('#')]
                urls_list.append({exp[i]: urls[i] for i in range(len(exp))})
            details = []
            for tt in urls_list[0]:
                number_part = re.search(r'\d+', tt).group()
                number = int(number_part)  # 纯数字集数   带文字的  直接用tt
                details_filter = {
                    'title': vod_name + tt,
                    'url': urls_list[0][tt],
                    'sort': number,
                    'is_free': 1,
                }
                details.append(MovieDetail(**details_filter))
            query_filter['details'] = details
            new_data = Movie(**query_filter)
            self.mysqlsession.add(new_data)
        self.mysqlsession.commit()
        return item

python-yt_dlp方法视频采集器

文件名目录名:python-yt_dlp

使用方法搜索:

【01】python开发之实例开发讲解-如何获取影视网站中经过保护后的视频-用python如何下载无法下载的视频资源含m3u8-python插件之dlp-举例几种-详解优雅草央千澈

本采集器很简单主要是以python yt_dlp库方法来采集下载m3u8视频。

相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
打赏
0
12
12
0
202
分享
相关文章
【01】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-硬件设备实时监控系统运营版发布-本产品基于企业级开源项目Zabbix深度二开-分步骤实现预计10篇合集-自营版
【01】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-硬件设备实时监控系统运营版发布-本产品基于企业级开源项目Zabbix深度二开-分步骤实现预计10篇合集-自营版
37 0
前端的全栈之路Meteor篇(一):开发环境的搭建 -全局安装或使用容器镜像
本文介绍了如何搭建 Meteor 开发环境,包括全局安装 Meteor 工具和使用 Docker 镜像两种方法,以及创建和运行一个简单的 Meteor 项目的基本步骤。 Meteor 是一个全栈 JavaScript 框架,适用于构建实时 Web 应用程序。文章还提供了遇到问题时的解决建议和调试技巧。
233 3
|
5月前
|
小红书笔记采集器
小红书笔记采集器
134 3
【揭秘可观测性】构建完美参考框架,打造系统监控的瑞士军刀!
【8月更文挑战第25天】在现代软件设计中,可观测性是确保系统稳定性和效率的关键因素。它主要由日志、指标及链路追踪(统称LMx)三大核心组件构成。本文详细介绍了构建高效可观测性框架的六个步骤:需求分析、工具选择、数据收集策略设计、实施集成、数据可视化及持续优化。并通过一个Spring Boot应用集成Prometheus和Micrometer收集指标的示例,展示了具体实践方法。合理构建可观测性框架能显著提升团队对软件系统的管理和监控能力,进而增强系统整体性能和可靠性。
106 2
分布式实战 | 第一篇 :ELK在开源全栈项目【有来商城】的应用,不仅仅是分布式日志收集(一)
分布式实战 | 第一篇 :ELK在开源全栈项目【有来商城】的应用,不仅仅是分布式日志收集(一)
分布式运维监控平台WGCLOUD 之 【常用命令笔记】
WGCLOUD 在 v3.4.9版本 新增了一个模块【常用命令笔记】
分布式实战 | 第一篇 :ELK在开源全栈项目【有来商城】的应用,不仅仅是分布式日志收集(二)
分布式实战 | 第一篇 :ELK在开源全栈项目【有来商城】的应用,不仅仅是分布式日志收集(二)
小众软件大盘点,这5款软件你一定要试一下!
你是否喜欢一些小众且无广告的软件?如果是的话,我这边有一些给你推荐的。
154 0
【滴滴开源运维监控系统】夜莺V5版本部署实践
【滴滴开源运维监控系统】夜莺V5版本部署实践
1186 0
【滴滴开源运维监控系统】夜莺V5版本部署实践