{"id":13467315,"url":"https://github.com/zythum/mama2","last_synced_at":"2026-04-04T19:20:01.621Z","repository":{"id":28813425,"uuid":"32336609","full_name":"zythum/mama2","owner":"zythum","description":"妈妈计划-众人拾柴火焰高","archived":false,"fork":false,"pushed_at":"2019-05-06T02:42:43.000Z","size":6418,"stargazers_count":2056,"open_issues_count":53,"forks_count":264,"subscribers_count":126,"default_branch":"master","last_synced_at":"2024-10-29T20:36:40.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zythum.github.io/mama2","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zythum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-16T16:03:02.000Z","updated_at":"2024-10-25T09:46:54.000Z","dependencies_parsed_at":"2022-09-05T02:21:51.501Z","dependency_job_id":null,"html_url":"https://github.com/zythum/mama2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zythum%2Fmama2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zythum%2Fmama2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zythum%2Fmama2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zythum%2Fmama2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zythum","download_url":"https://codeload.github.com/zythum/mama2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245571713,"owners_count":20637383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:00:55.007Z","updated_at":"2026-04-04T19:20:01.571Z","avatar_url":"https://github.com/zythum.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Clients"],"sub_categories":["Browser Extension"],"readme":"#妈妈再也不用担心我的 MacBook 发热了计划2\n\n\u003e 妈妈计划用于解决在看视频网站时 MacBook 发热严重的问题。使用video来替换原来的flash播放器。\n\n[具体查看这里 http://zythum.github.io/mama2/](http://zythum.github.io/mama2/)\n\n__目前鹅厂视频－－腾讯视频已经原生支持 Video 播放了。大家可以去试下__\n\n目前网站支持列表:\n\n+ 哔哩哔哩弹幕视频网 @朱一\n+ 优酷-中国领先视频网站 @朱一\n+ 土豆-每个人都是生活的导演 @朱一\n+ ~~爱奇艺-中国领先的视频门户 @朱一~~\n+ 搜狐视频 @朱一\n+ 芒果tv [@zhshipu](https://github.com/zhshipu)\n+ 熊猫tv [@pczb](https://github.com/pczb)\n+ 91porn\n+ 百度网盘 @朱一\n+ 音悦台 [@mhcgrq](https://github.com/mhcgrq)\n+ 秒拍 @朱一\n\n感谢 [一环同学](http://weibo.com/justashit)提供的缺省解析服务（如果不是上面的网站，能播放的都是一环同学的功劳。）\n\n\n\n##众人拾柴火焰高 计划\n\u003e 加入妈妈计划开发，视频网站的解析朱一一个人确实是搞不过来。每个视频网站的解析规则可能会不定时的改变。朱一每天也就看看优酷或者bilibili，不大可能照顾到所有网站（毕竟是个业余项目QAQ）。所以如果你觉得妈妈计划不错，想帮助妈妈计划做的更好，恳请您加入*众人拾柴火焰高*计划。\n\n###搭建本地环境\n\n[具体查看这里 http://zythum.github.io/mama2/](http://zythum.github.io/mama2/)\n\nMAMA2需要本地环境: `node` `npm` `gulp`\n\nclone到本地后执行: `$ npm install`\n\n然后执行: `$ npm start` 或者 `$ gulp`\n\n本地启动的httpServer默认为 `http://localhost:8000`\n\n那么本地环境就搭建好了。\n\n⚠注意: 在开发工程中，确保你的本地环境时开启状态\n\n开发使用收藏夹脚本:[拖拽我到收藏夹](javascript:void\\(function\\(u,s\\){s=document.body.appendChild\\(document.createElement\\('script'\\)\\);s.src=u+'?ts='+Date.now\\(\\);s.charset='UTF-8'}\\('http://localhost:8000/dest/index.js'\\)\\))\n\n###开发说明\n\n现在的目录结构是这样的\n\n![image](http://zythum.github.io/mama2/images/ll.png)\n\n很凌乱有木有。QAQ\n\n其实一般只需要编写用于获取视频地址的逻辑，我这边称为`seeker`。所以只需要注意 `seeker-` 打头的文件，和 `seekers` 的文件就可以了\n\n###举个例子🌰\n我们要为名为 `example` 的视频网站写seeker脚本\n\n\n在src目录下创建 seeker_example.js 文件。\n\n我已经创建好了。文件是这样的\n\n注释很丰富的样子。所以大家看注释吧。嚯嚯嚯嚯\n\n```javascript\n//============目前已有的工具函数==============\n\n/*  ＃Bool canPlayM3U8＃\n *  返回浏览器是否支持m3u8格式的视频播放。\n *  目前chrome,firefox只支持mp4\n */\nvar canPlayM3U8 = require('./canPlayM3U8')\n\n\n\n/*  ＃function queryString#\n *  \u003c Object   例如 {a:1,b:2,c:3}\n *  \u003e String   例如 a=1\u0026b=2\u0026c=3\n *  用于拼装url地址的query\n */\nvar queryString = require('./queryString')\n\n\n\n/*  ＃function ajax#\n *  \u003c {\n *    url:          String   请求地址\n *    method:       String   请求方法GET,POST,etc. 可缺省，默认是GET\n *    param:        Object   请求参数.可缺省\n *    callback:     Function 请求的callback, 如果失败返回－1， 成功返回内容\n *    contentType:  String   返回内容的格式。如果是JOSN会做JSON Parse， 可缺省,默认是json\n *    context:      Any      callback回调函数的this指向。可缺省\n *  }\n *  用于发起ajax或者jsonp请求\n */\nvar ajax = require('./ajax')\n\n\n/*  ＃function httpProxy#\n *  \u003c String        请求地址\n *  \u003c String        请求方法GET,POST,etc.\n *  \u003c Object        请求参数\n *  \u003c Function      请求的callback, 如果失败返回－1， 成功返回内容\n *  \u003c {\n *      xml:        是否需要做xml2json 可缺省\n *      gzinflate   是否需要做gzinflate 可缺省\n *      context     callback回调的this指向 可缺省\n *    }\n *  }\n *  用于发起跨域的ajax请求。既接口返回跨域又不支持jsonp协议的\n */\nvar httpProxy = require('./httpProxy')\n\n\n/*  ＃function log＃\n *  \u003c String\n *  \u003c Number  log在页面出现的时间。可缺省\n *  log, 会在页面和console中输出log\n */\nvar log = require('./log')\n\n\n\n//============下面是重点，每个seeker必须有==============\n\n\n/*  ＃function match＃\n *  \u003e Bool\n *\n *  返回是否该页面匹配这个解析脚本，\n *  这个脚本会在页面的环境中运行。window是页面的window。\n *  你可以从location中或者页面特征中找到是否需要匹配执行下面脚本\n *  ＃注意＃：\n *  如果match方法返回true就不会再遍历其他的seeker脚本了。所以请尽量严谨\n */\nexports.match = function () {\n\t//举个例子\n\treturn /^http\\:\\/\\/example.com/.test(location.href) \u0026\u0026 !!window.example\n}\n\n\n\n/*  ＃function getVideos＃\n *\t\u003c callback([[\"影片名称\", \"影片地址\"], [\"影片名称2\", \"影片地址2\"]...])\n *  \n *\t如果上面的match方法返回true。那么就会执行到getVideos方法\n *  该方法用于获取视频源地址\n *  同样\n *  这个脚本会在页面的环境中运行。window是页面的window。\n *  你可以从location中或者页面特征中找到获取视频源地址的方法\n *  该脚本用callback方法提交，格式为[[\"影片名称\", \"影片地址\"], [\"影片名称2\", \"影片地址2\"]...]\n */\nexports.getVideos = function (callback) {\n\t//举个例子\n\tcallback([\n\t\t[\"高清\": \"http://xxxxx.xxxx.xxx/xxx/xxx/xxx/xxx.m3u8\"],\n\t\t[\"标清\": \"http://xxxxx.xxxx.xxx/xxx/xxx/xxx/xxx.mp4\"]\n\t])\n}\n```\n\n然后需要在 seekers.js 文件中加上一行\n\n```javascript\nmodule.exports = [\n\trequire('./seeker_bilibili'),\n\trequire('./seeker_youku'),\n\trequire('./seeker_example') //在这边加上一行，#注意上一个逗号#\n]\n```\n\n大功告成！用浏览器上的开发用收藏夹脚本测试下。\n\n如果测试ok的话, 那么把代码pull request给朱一吧。\n\n不方便pull request？\n\n那么用email给朱一也是可以的 zythum02@gmail.com\n\n\n##License##\n\nMAMA2 is under the MIT License.\n\n据说总是需要放个证书的。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzythum%2Fmama2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzythum%2Fmama2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzythum%2Fmama2/lists"}