├── db.sqlite3
├── ks
├── __init__.py
├── __pycache__
│ ├── urls.cpython-37.pyc
│ ├── wsgi.cpython-37.pyc
│ ├── __init__.cpython-37.pyc
│ └── settings.cpython-37.pyc
├── wsgi.py
├── urls.py
└── settings.py
├── myks
├── __init__.py
├── migrations
│ ├── __init__.py
│ └── __pycache__
│ │ └── __init__.cpython-37.pyc
├── models.py
├── admin.py
├── tests.py
├── static
│ └── myks
│ │ ├── img
│ │ ├── 01.jpg
│ │ ├── 02.jpg
│ │ ├── 03.jpg
│ │ ├── 04.jpg
│ │ ├── 05.jpg
│ │ ├── icon.png
│ │ ├── logo.png
│ │ ├── loading.gif
│ │ └── index-thumbnail
│ │ │ ├── muqin.jpg
│ │ │ ├── yichuhaoxi.jpg
│ │ │ ├── aiqinggongyu.jpg
│ │ │ └── jiangshishijie.jpg
│ │ ├── fonts
│ │ ├── iconfont.eot
│ │ ├── iconfont.ttf
│ │ ├── iconfont.woff
│ │ ├── iconfont.woff2
│ │ ├── iconfont.css
│ │ ├── demo.css
│ │ ├── iconfont.svg
│ │ ├── iconfont.js
│ │ └── demo_index.html
│ │ ├── js
│ │ ├── adjust.js
│ │ ├── search-list.js
│ │ ├── video.js
│ │ ├── drag.js
│ │ ├── classification.js
│ │ └── carousel.js
│ │ └── css
│ │ ├── fonts.css
│ │ ├── classification.less
│ │ ├── same.less
│ │ ├── same.css
│ │ ├── search-list.less
│ │ ├── base.css
│ │ ├── index.css
│ │ ├── video.less
│ │ ├── index.less
│ │ ├── classification.css
│ │ ├── search-list.css
│ │ └── video.css
├── templates
│ ├── img
│ │ └── timg.gif
│ └── myks
│ │ └── index.html
├── apps.py
├── __pycache__
│ ├── admin.cpython-37.pyc
│ ├── urls.cpython-37.pyc
│ ├── views.cpython-37.pyc
│ ├── __init__.cpython-37.pyc
│ └── models.cpython-37.pyc
├── spider.py
├── urls.py
└── views.py
├── play_ks
├── ks_sig.jar
├── __pycache__
│ ├── a.cpython-37.pyc
│ ├── klh.cpython-37.pyc
│ ├── spider.cpython-37.pyc
│ └── ks_spider.cpython-37.pyc
├── spider.py
├── b.py
├── a.py
├── ks_spider.py
├── klh.py
└── rjh.py
├── __pycache__
└── spider.cpython-37.pyc
├── README.md
├── spider.py
└── manage.py
/db.sqlite3:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ks/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/myks/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/myks/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/myks/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/myks/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/myks/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/play_ks/ks_sig.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/play_ks/ks_sig.jar
--------------------------------------------------------------------------------
/myks/static/myks/img/01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/01.jpg
--------------------------------------------------------------------------------
/myks/static/myks/img/02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/02.jpg
--------------------------------------------------------------------------------
/myks/static/myks/img/03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/03.jpg
--------------------------------------------------------------------------------
/myks/static/myks/img/04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/04.jpg
--------------------------------------------------------------------------------
/myks/static/myks/img/05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/05.jpg
--------------------------------------------------------------------------------
/myks/templates/img/timg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/templates/img/timg.gif
--------------------------------------------------------------------------------
/myks/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class MyksConfig(AppConfig):
5 | name = 'myks'
6 |
--------------------------------------------------------------------------------
/myks/static/myks/img/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/icon.png
--------------------------------------------------------------------------------
/myks/static/myks/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/logo.png
--------------------------------------------------------------------------------
/myks/static/myks/img/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/loading.gif
--------------------------------------------------------------------------------
/__pycache__/spider.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/__pycache__/spider.cpython-37.pyc
--------------------------------------------------------------------------------
/ks/__pycache__/urls.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/ks/__pycache__/urls.cpython-37.pyc
--------------------------------------------------------------------------------
/ks/__pycache__/wsgi.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/ks/__pycache__/wsgi.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/static/myks/fonts/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/fonts/iconfont.eot
--------------------------------------------------------------------------------
/myks/static/myks/fonts/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/fonts/iconfont.ttf
--------------------------------------------------------------------------------
/myks/__pycache__/admin.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/__pycache__/admin.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/__pycache__/urls.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/__pycache__/urls.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/__pycache__/views.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/__pycache__/views.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/static/myks/fonts/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/fonts/iconfont.woff
--------------------------------------------------------------------------------
/myks/static/myks/fonts/iconfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/fonts/iconfont.woff2
--------------------------------------------------------------------------------
/play_ks/__pycache__/a.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/play_ks/__pycache__/a.cpython-37.pyc
--------------------------------------------------------------------------------
/ks/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/ks/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/ks/__pycache__/settings.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/ks/__pycache__/settings.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/__pycache__/models.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/__pycache__/models.cpython-37.pyc
--------------------------------------------------------------------------------
/play_ks/__pycache__/klh.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/play_ks/__pycache__/klh.cpython-37.pyc
--------------------------------------------------------------------------------
/play_ks/__pycache__/spider.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/play_ks/__pycache__/spider.cpython-37.pyc
--------------------------------------------------------------------------------
/play_ks/__pycache__/ks_spider.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/play_ks/__pycache__/ks_spider.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/static/myks/img/index-thumbnail/muqin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/index-thumbnail/muqin.jpg
--------------------------------------------------------------------------------
/myks/migrations/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/migrations/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/myks/static/myks/img/index-thumbnail/yichuhaoxi.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/index-thumbnail/yichuhaoxi.jpg
--------------------------------------------------------------------------------
/myks/static/myks/img/index-thumbnail/aiqinggongyu.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/index-thumbnail/aiqinggongyu.jpg
--------------------------------------------------------------------------------
/myks/static/myks/img/index-thumbnail/jiangshishijie.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/konglinghao75/kuaishou/HEAD/myks/static/myks/img/index-thumbnail/jiangshishijie.jpg
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # kuaishou
2 | 爬取快手热门视频,每个视频评论,用户详情数据,用户所有个人作品
3 | 过程当中遇到评论,个人作品的签名加密,用的JAVA破解SIG加密在蟒蛇当中调用JAVA,遇到启动虚拟机错误,解决方法初始化类只用用类PUT方法删除只实例化一次JAVA虚拟机对象,ks_sig.JAR为调用JAVA解密的JAR包,ks_spider为评论代码,KLH为热门二十作品,个人所有作品代码,RJH为个人详细信息代码,在写评论和个人作品时遇到参数解密,获取问题,获取热门数据时遇到数据错误问题,解决通过作品ID去用户个人作品信息里找相同作品ID,拿到其中的正确数据,在展示数据时多些一条判断获取可播放正确数据
4 |
--------------------------------------------------------------------------------
/myks/static/myks/js/adjust.js:
--------------------------------------------------------------------------------
1 | !(function () {
2 | var styleN = document.createElement('style');
3 | var w = document.documentElement.clientWidth/16;
4 | styleN.innerHTML = "html{font-size:"+ w +"px!important;}";
5 | document.head.appendChild(styleN);
6 | })()
7 | // 阻止默认行为
8 | // document.addEventListener('touchstart', function (ev) {
9 | // ev = ev || event;
10 | // ev.preventDefault();
11 | // }, {passive: true})
12 |
--------------------------------------------------------------------------------
/myks/static/myks/js/search-list.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $.ajax({
3 | url: '../data.json',
4 | type: 'get',
5 | error: function (err) {
6 | if(err) throw err;
7 | },
8 | success: function (ret) {
9 | console.table(ret);
10 |
11 | var tempCont = $('#video-temp').html();
12 | var htmlText = _.template(tempCont);
13 | var NewHtml = htmlText({data: ret});
14 | $(".search-list >.list-wrap").html(NewHtml);
15 | }
16 | })
17 | })
--------------------------------------------------------------------------------
/ks/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for ks project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ks.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/spider.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Wed May 29 10:28:18 2019
4 |
5 | @author: 一文 --最远的你们是我最近的爱
6 | """
7 |
8 | import requests
9 | import json
10 |
11 | class Spider:
12 |
13 | def get_html(self, url, encoding = None):
14 |
15 | r = requests.get(url)
16 |
17 | if encoding == None:
18 |
19 | r.encoding= r.apparent_encoding
20 |
21 | else:
22 |
23 | r.encoding = encoding
24 |
25 | return json.loads(r.text)
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/myks/spider.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Wed May 29 10:28:18 2019
4 |
5 | @author: 一文 --最远的你们是我最近的爱
6 | """
7 |
8 | import requests
9 | import json
10 |
11 | class Spider:
12 |
13 | def get_html(self, url, encoding = None):
14 |
15 | r = requests.get(url)
16 |
17 | if encoding == None:
18 |
19 | r.encoding= r.apparent_encoding
20 |
21 | else:
22 |
23 | r.encoding = encoding
24 |
25 | return json.loads(r.text)
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/play_ks/spider.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Wed May 29 10:28:18 2019
4 |
5 | @author: 一文 --最远的你们是我最近的爱
6 | """
7 |
8 | import requests
9 | import json
10 |
11 | class Spider:
12 |
13 | def get_html(self, url, encoding = None):
14 |
15 | r = requests.get(url)
16 |
17 | if encoding == None:
18 |
19 | r.encoding= r.apparent_encoding
20 |
21 | else:
22 |
23 | r.encoding = encoding
24 |
25 | return json.loads(r.text)
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ks.settings')
9 | try:
10 | from django.core.management import execute_from_command_line
11 | except ImportError as exc:
12 | raise ImportError(
13 | "Couldn't import Django. Are you sure it's installed and "
14 | "available on your PYTHONPATH environment variable? Did you "
15 | "forget to activate a virtual environment?"
16 | ) from exc
17 | execute_from_command_line(sys.argv)
18 |
19 |
20 | if __name__ == '__main__':
21 | main()
22 |
--------------------------------------------------------------------------------
/play_ks/b.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Thu Jun 20 20:49:16 2019
4 |
5 | @author: 一文 --最远的你们是我最近的爱
6 | """
7 |
8 | import requests
9 |
10 | import json
11 |
12 | url = 'http://101.251.217.216/rest/n/feed/hot?isp=CMCC&mod=lemobile%28le%20x620%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&extId=59942a6c1d534a51844dfda37e92afc3&did=ANDROID_72c3ac6bd3184a67&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560736770695&ver=6.1&max_memory=192&type=7&page=1&coldStart=false&count=20&pv=false&id=23&refreshTimes=7&pcursor=&source=1&needInterestTag=false&client_key=3c2cd3f3&os=android&sig=510e56b366931c4cb008c51ee44664c2'
13 |
14 | a = requests.get(url).text
15 |
16 | b = json.loads(a)
17 |
18 | b = b['feeds']
19 |
--------------------------------------------------------------------------------
/ks/urls.py:
--------------------------------------------------------------------------------
1 | """ks URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/2.2/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.contrib import admin
17 | from django.urls import path, include
18 |
19 | urlpatterns = [
20 |
21 | path('jsbk/', include('myks.urls')),
22 | path('admin/', admin.site.urls),
23 | ]
24 |
--------------------------------------------------------------------------------
/play_ks/a.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Wed May 29 10:28:18 2019
4 |
5 | @author: 一文 --最远的你们是我最近的爱
6 | """
7 |
8 | import jpype
9 | import os
10 |
11 |
12 | jarpath = os.path.join(os.path.abspath("."), "E:\\play_ks\\")
13 |
14 | jvmPath = r'E:\Java\jre1.8.0_101\bin\server\jvm.dll'
15 |
16 | jpype.startJVM(jvmPath, "-ea","-Djava.class.path=%s" % (jarpath + 'ks_sig.jar'))
17 |
18 | javaClass = jpype.JClass("SingatureUtil")
19 |
20 | t = javaClass()
21 |
22 | a='isp=CMCC&mod=vivo%28vivo%20x5m%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_d1f47e9473209293&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560817030537&ver=6.1&retryTimes=1&max_memory=192&photoId=5228679183663739838&user_id=1295159539&pcursor102117525349&order=desc&count=10&photoPageType=0&client_key=3c2cd3f3&os=android'
23 |
24 | sig = t.run(a)
--------------------------------------------------------------------------------
/myks/urls.py:
--------------------------------------------------------------------------------
1 | """ks URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/2.2/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 |
17 |
18 | from django.urls import path
19 | from . import views
20 |
21 | app_name = 'myks'
22 |
23 | urlpatterns = [
24 |
25 | path('', views.index, name = 'index'),
26 |
27 | #path('get/', views.search_get, name = 'movies'),
28 |
29 | #path('play/', views.play, name = 'play'),
30 |
31 | #path('admin/', admin.site.urls),
32 | ]
33 |
--------------------------------------------------------------------------------
/myks/static/myks/css/fonts.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: '../fonts/iconfont';
3 | src: url('../fonts/iconfont.eot');
4 | src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'),
5 | url('../fonts/iconfont.woff2') format('woff2'),
6 | url('../fonts/iconfont.woff') format('woff'),
7 | url('../fonts/iconfont.ttf') format('truetype'),
8 | url('../fonts/iconfont.svg#iconfont') format('svg');
9 | }
10 | .iconfont{
11 | font-family:"../fonts/iconfont" !important;
12 | font-size:12px;font-style:normal;
13 | -webkit-font-smoothing: antialiased;
14 | -webkit-text-stroke-width: 0.2px;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
17 | /* @font-face {
18 | font-family: 'iconfont';
19 | src: url('//at.alicdn.com/t/font_1181482_hj3ydlx6ack.eot');
20 | src: url('//at.alicdn.com/t/font_1181482_hj3ydlx6ack.eot?#iefix') format('embedded-opentype'),
21 | url('//at.alicdn.com/t/font_1181482_hj3ydlx6ack.woff2') format('woff2'),
22 | url('//at.alicdn.com/t/font_1181482_hj3ydlx6ack.woff') format('woff'),
23 | url('//at.alicdn.com/t/font_1181482_hj3ydlx6ack.ttf') format('truetype'),
24 | url('//at.alicdn.com/t/font_1181482_hj3ydlx6ack.svg#iconfont') format('svg');
25 | } */
--------------------------------------------------------------------------------
/myks/static/myks/js/video.js:
--------------------------------------------------------------------------------
1 | function parseUrl(url){
2 | if(url.indexOf("?") == -1) {
3 | return {};
4 | }
5 | var query = url.split("?")[1];
6 | var queryArr = query.split("&");
7 | var obj = {};
8 | queryArr.forEach(function(item){
9 | var key = item.split("=")[0];
10 | var value = item.split("=")[1];
11 | obj[key] = decodeURIComponent(value);
12 | });
13 | return obj;
14 | }
15 | function play(url) {
16 | if(Hls.isSupported()) {
17 | var hls = new Hls();
18 | // hls.loadSource('https://www.697313.com:65/20190516/Y4xV3No4/index.m3u8');
19 | hls.loadSource(url);
20 | hls.attachMedia(video);
21 | hls.on(Hls.Events.MANIFEST_PARSED,function() {
22 | video.play();
23 | });
24 | }
25 | }
26 | $(function () {
27 | var video = document.getElementById('video');
28 | video.style.width = document.documentElement.clientWidth + 'px'
29 | $.ajax({
30 | url: '../data.json',
31 | type: 'get',
32 | error: function (err) {
33 | if(err) throw err;
34 | },
35 | success: function (ret) {
36 | console.log(ret);
37 |
38 | for (var key in ret) {
39 | if (ret[key].name == parseUrl(location.search).name) {
40 | var current = ret[key]
41 | $("#cont_jianj_name").html(current.name)
42 | $("#cont_jianj_text").html(current.jie_shao)
43 | console.log(current.jieshao);
44 |
45 | play(current.show_url[0][0])
46 | }
47 | }
48 | }
49 | })
50 | })
--------------------------------------------------------------------------------
/myks/static/myks/js/drag.js:
--------------------------------------------------------------------------------
1 | ;(function(w){
2 | w.zm={};
3 | w.zm.drag=function(testNode,callBack){
4 | //抽象元素一开始的位置
5 | var startPoint={x:0,y:0};
6 | //抽象鼠标一开始的位置
7 | var elementPoint={x:0,y:0};
8 |
9 | testNode.onmousedown=function(ev){
10 | ev = ev||event;
11 |
12 | if(testNode.setCapture){
13 | testNode.setCapture();
14 | }
15 |
16 | startPoint.x = testNode.offsetLeft;
17 | startPoint.y = testNode.offsetTop;
18 |
19 |
20 | elementPoint.x = ev.clientX;
21 | elementPoint.y = ev.clientY;
22 |
23 | document.onmousemove=function(ev){
24 | ev = ev||event;
25 | var nowPoint={x:0,y:0};
26 | nowPoint.x = ev.clientX;
27 | nowPoint.y = ev.clientY;
28 |
29 | var L = startPoint.x + (nowPoint.x - elementPoint.x );
30 |
31 | if(L<0){
32 | L=0;
33 | }else if(L>( testNode.parentNode.clientWidth -testNode.offsetWidth )){
34 | L = testNode.parentNode.clientWidth - testNode.offsetWidth;
35 | }
36 |
37 | testNode.style.left=L+"px";
38 |
39 |
40 | if(callBack&&callBack["move"]&& typeof callBack["move"] === "function"){
41 | callBack["move"].call(testNode);
42 | }
43 | }
44 |
45 | document.onmouseup=function(){
46 | document.onmousemove = document.onmouseup =null;
47 | if(document.releaseCapture){
48 | document.releaseCapture();
49 | }
50 | }
51 |
52 | return false;
53 | }
54 | }
55 | })(window)
56 |
--------------------------------------------------------------------------------
/myks/static/myks/css/classification.less:
--------------------------------------------------------------------------------
1 | @import './fonts.css';
2 | @import './same.less';
3 | body{
4 | .header()
5 | }
6 | // ../public/img/loading.gif
7 | .wrap{
8 | .movie-plate{
9 | .plate-head{
10 | display: flex;
11 | height: 1.3rem;
12 | padding: 0.3rem 1.1rem;
13 | border-bottom: 1px #f4f4f4 solid;
14 | a{
15 | font: 0.9rem/1.3rem sans-serif;
16 | font-weight: bold;
17 | &.movie-t{
18 | flex: 2;
19 | }
20 | &.more-t{
21 | flex: 3;
22 | text-align: right;
23 | font-size: 0.6rem;
24 | font-weight: 500;
25 | color: #949999;
26 | }
27 | }
28 | }
29 | .movie-wrap{
30 | margin-top: .3rem;
31 | .movie-thumbnail {
32 | .movie-row {
33 | &>li{
34 | float: left;
35 | width: 32%;
36 | height: 10rem;
37 | padding: .6rem .2rem;
38 | overflow: hidden;
39 | &>a{
40 | display: block;
41 | width: 100%;
42 | border-top-left-radius: .8rem;
43 | border-top-right-radius: .8rem;
44 | img{
45 | height: 7rem;
46 | display: block;
47 | width: 100%;
48 | border-top-left-radius: .8rem;
49 | border-top-right-radius: .8rem;
50 | background: url(../img/loading.gif) no-repeat center;
51 | }
52 | h3{
53 | font: .6rem sans-serif;
54 | margin: 0.3rem 0;
55 | font-weight: bolder;
56 | white-space: nowrap;
57 | overflow: hidden;
58 | text-overflow: ellipsis;
59 | }
60 | p{
61 | color: #949999;
62 | white-space: nowrap;
63 | overflow: hidden;
64 | text-overflow: ellipsis;
65 | }
66 | }
67 | }
68 | }
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/myks/static/myks/css/same.less:
--------------------------------------------------------------------------------
1 | @rem: 750/16rem;
2 | .header{
3 | // 返回
4 | margin-bottom: 20/@rem;
5 | .back{
6 | float: left;
7 | width: 15%;
8 | height: 63/@rem;
9 | padding: .2rem .1rem;
10 | a{
11 | display: block;
12 | width: 100%;
13 | height: 100%;
14 | font-size: 35/@rem;
15 | text-align: center;
16 | line-height: 63/@rem;
17 | position: relative;
18 | left: 10/@rem;
19 | }
20 | &::after{
21 | content: '';
22 | width:0;
23 | height:0;
24 | border-width:14/@rem 30/@rem 14/@rem 0;
25 | border-style:solid;
26 | border-color:transparent #222020 transparent transparent;/*透明 灰 透明 透明 */
27 | position: absolute;
28 | top:26/@rem;
29 | left: 0/@rem;
30 | }
31 |
32 | }
33 | // 搜索
34 | .search{
35 | float: right;
36 | width: 80%;
37 | padding: .2rem .1rem;
38 | form{
39 | width: 100%;
40 | height: 100%;
41 | border-radius: 54/@rem;
42 | border: 1px solid rgb(255, 255, 255);
43 | transition: .2s box-shadow;
44 | input.search-inp{
45 | float: left;
46 | box-sizing: border-box;
47 | width: 76%;
48 | height: 63/@rem;
49 | font-size: 0.707407rem;
50 | color: #fff;
51 | background: #ff8d1b;
52 | padding: 20/@rem 24/@rem;
53 | border-radius: 54/@rem 0 0 54/@rem;
54 | &::-webkit-input-placeholder {
55 | /* placeholder颜色 */
56 | color: #f4f4f5cc;
57 | /* placeholder字体大小 */
58 | font-size: 12px;
59 | /* placeholder位置 */
60 | text-align: left;
61 | }
62 | }
63 | button.search-btn{
64 | float: left;
65 | width: 24%;
66 | height: 63/@rem;
67 | background: #181717;
68 | color: #fff;
69 | font-size: 0.64740741rem;
70 | border-radius: 0 54/@rem 54/@rem 0;
71 | }
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/myks/static/myks/css/same.css:
--------------------------------------------------------------------------------
1 | .header {
2 | margin-bottom: 0.42666667rem;
3 | }
4 | .header .back {
5 | float: left;
6 | width: 15%;
7 | height: 1.344rem;
8 | padding: .2rem .1rem;
9 | }
10 | .header .back a {
11 | display: block;
12 | width: 100%;
13 | height: 100%;
14 | font-size: 0.74666667rem;
15 | text-align: center;
16 | line-height: 1.344rem;
17 | position: relative;
18 | left: 0.21333333rem;
19 | }
20 | .header .back::after {
21 | content: '';
22 | width: 0;
23 | height: 0;
24 | border-width: 0.29866667rem 0.64rem 0.29866667rem 0;
25 | border-style: solid;
26 | border-color: transparent #222020 transparent transparent;
27 | /*透明 灰 透明 透明 */
28 | position: absolute;
29 | top: 0.55466667rem;
30 | left: 0rem;
31 | }
32 | .header .search {
33 | float: right;
34 | width: 80%;
35 | padding: .2rem .1rem;
36 | }
37 | .header .search form {
38 | width: 100%;
39 | height: 100%;
40 | border-radius: 1.152rem;
41 | border: 1px solid #ffffff;
42 | transition: 0.2s box-shadow;
43 | }
44 | .header .search form input.search-inp {
45 | float: left;
46 | box-sizing: border-box;
47 | width: 76%;
48 | height: 1.344rem;
49 | font-size: 0.707407rem;
50 | color: #fff;
51 | background: #ff8d1b;
52 | padding: 0.42666667rem 0.512rem;
53 | border-radius: 1.152rem 0 0 1.152rem;
54 | }
55 | .header .search form input.search-inp::-webkit-input-placeholder {
56 | /* placeholder颜色 */
57 | color: #f4f4f5cc;
58 | /* placeholder字体大小 */
59 | font-size: 12px;
60 | /* placeholder位置 */
61 | text-align: left;
62 | }
63 | .header .search form button.search-btn {
64 | float: left;
65 | width: 24%;
66 | height: 1.344rem;
67 | background: #181717;
68 | color: #fff;
69 | font-size: 0.64740741rem;
70 | border-radius: 0 1.152rem 1.152rem 0;
71 | }
72 |
--------------------------------------------------------------------------------
/myks/static/myks/js/classification.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $.ajax({
3 | url: '../data.json',
4 | type: 'get',
5 | error: function (err) {
6 | if(err) console.log(err);;
7 | },
8 | success: function (ret) {
9 | console.table(ret);
10 |
11 | fn(ret)
12 |
13 | // var tempCont = $('#movie-temp').html();
14 | // var htmlText = _.template(tempCont);
15 | // var NewHtml = htmlText({data: ret});
16 | // $("#movie-row").html(NewHtml);
17 | }
18 | })
19 |
20 | function fn(arr) {
21 |
22 | var tempCont = $('#movie-temp').html();
23 | var htmlText = _.template(tempCont);
24 | var NewHtml = htmlText({data: arr});
25 | $("#movie-row").html(NewHtml);
26 |
27 | // var wap = $('.main');
28 | var offTop = function (ele) {
29 | var top = null;
30 | var eleTop = ele.offsetTop;
31 | var eleParent = ele.offsetParent;
32 | top += eleTop;
33 | while (eleParent) {
34 | top += eleParent.offsetTop;
35 | eleParent = eleParent.offsetParent;
36 | }
37 | return top;
38 | }
39 |
40 | function loadimg(img) {
41 |
42 | var winTop = $(window).height() + $(window).scrollTop();
43 | var imgTop = offTop(img) + img.offsetHeight;
44 | if (winTop > imgTop) {
45 | if (img.isload == true) {
46 | return
47 | }
48 | var imgs = new Image;
49 | imgs.src = img.getAttribute("data-src")
50 | imgs.onload = function () {
51 | img.src = this.src;
52 | }
53 | img.isload = true;
54 | }
55 | }
56 |
57 |
58 | var imgs = $('img');
59 | console.log(imgs);
60 | function allload() {
61 |
62 | $.each(imgs, function (index, value) {
63 |
64 | if (imgs[index].isload) {
65 | return;
66 | }
67 |
68 | loadimg(imgs[index])
69 | })
70 | }
71 |
72 | setTimeout(function () {
73 | allload()
74 | }, 1000)
75 |
76 | $(window).scroll(function () {
77 | allload()
78 | })
79 | }
80 |
81 |
82 | })
83 |
--------------------------------------------------------------------------------
/myks/static/myks/css/search-list.less:
--------------------------------------------------------------------------------
1 | @import './fonts.css';
2 | @import './same.less';
3 | @rem: 750/16rem;
4 |
5 | // 头部
6 | body{
7 | .header()
8 | }
9 | // 查询统计
10 | .search-stats{
11 | .header{
12 | font-size: 31/@rem;
13 | height: 81/@rem;
14 | line-height: 81/@rem;
15 | text-align: center;
16 | color: #1c85d4;
17 | }
18 | // 分割线
19 | .line{
20 | width: 100%;
21 | height: 1px;
22 | background: #1c85d4;
23 | }
24 | }
25 |
26 | // 查询结果
27 | .search-list{
28 | box-sizing: border-box;
29 | background: #f5f5f5;
30 | padding-top: 14/@rem;
31 | .list-wrap{
32 | li{
33 | box-sizing: border-box;
34 | background: #fff;
35 | padding: 9/@rem;
36 | margin-bottom: 19/@rem;
37 | border-radius: 20/@rem;
38 | box-shadow: 4/@rem 2/@rem 30/@rem 4/@rem rgba(0,0,0,.1);
39 | a{
40 | display: block;
41 | width: 100%;
42 | height: 318/@rem;
43 | .left-box{
44 | float: left;
45 | width: 222/@rem;
46 | height: 318/@rem;
47 | img{
48 | border-radius: 20/@rem;
49 | width: 100%;
50 | height: 100%;
51 | }
52 | }
53 | .right-box{
54 | float: left;
55 | width: 400/@rem;
56 | margin-left: 23/@rem;
57 | .video-title{
58 | box-sizing: border-box;
59 | font-size: 29/@rem;
60 | padding: 20/@rem 0;
61 | color: #1c85d4;
62 | text-align: left;
63 | font-weight: bold;
64 | }
65 | .cont{
66 | box-sizing: border-box;
67 | padding: 7/@rem 0;
68 | font-size: 26/@rem;
69 | .p{
70 | width: 100%;
71 | &:nth-child(2){
72 | width: 390/@rem;
73 | overflow: hidden;
74 | white-space: nowrap;text-overflow: ellipsis;
75 | }
76 | .le{
77 | color: #3F4953;
78 | }
79 | .ri{
80 | color: #7a8f25;
81 | overflow: hidden;
82 | }
83 |
84 | }
85 | .pt{
86 | margin-top: 8/@rem;
87 | }
88 | }
89 | }
90 | }
91 | }
92 | }
93 | }
--------------------------------------------------------------------------------
/myks/templates/myks/index.html:
--------------------------------------------------------------------------------
1 | {%load static%}
2 |
3 |
4 |
5 |
6 |
7 |
8 | 查询结果
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
25 |
26 |
27 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/myks/views.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Tue Jun 18 09:11:53 2019
4 |
5 | @author: 一文 --最远的你们是我最近的爱
6 | """
7 |
8 | from django.shortcuts import render
9 |
10 | from django.http import HttpResponse, JsonResponse
11 |
12 | import json
13 |
14 | import time
15 |
16 | import jpype
17 |
18 | from play_ks.ks_spider import Ks_spider
19 |
20 | import os
21 |
22 | import multiprocessing
23 |
24 | from play_ks.klh import kuaishou
25 |
26 |
27 | def load_jar(q):# 加载jar包
28 |
29 | jarpath = os.path.join(os.path.abspath("."), "E:\\ks\\play_ks\\")
30 |
31 | jvmPath = r'E:\Java\jre1.8.0_101\bin\server\jvm.dll'
32 |
33 | jpype.startJVM(jvmPath, "-ea","-Djava.class.path=%s" % (jarpath + 'ks_sig.jar'))
34 |
35 | javaClass = jpype.JClass("SingatureUtil")
36 |
37 | info = kuaishou(javaClass).pro()
38 |
39 | q.put(info)
40 |
41 |
42 |
43 | def index(request):#首页API随机加载20视频
44 |
45 |
46 | start=time.time()
47 |
48 | q = multiprocessing.Queue()
49 |
50 | p = multiprocessing.Process(target=load_jar, args=[q])
51 |
52 | p.daemon = True
53 |
54 | p.start()
55 |
56 | info = q.get()
57 |
58 | index_info = []
59 |
60 | for i in info:
61 |
62 | try:
63 |
64 | if i['main_mv_urls'][1]['url'][0:13] == 'http://txmov2':
65 |
66 | i['play_url'] = i['main_mv_urls'][1]['url']
67 |
68 | index_info.append(i)
69 |
70 |
71 | if i['main_mv_urls'][1]['url'][0:13] != 'http://txmov2':
72 |
73 | i['play_url'] = i['main_mv_urls'][0]['url']
74 |
75 | index_info.append(i)
76 |
77 | except KeyError:
78 |
79 | info.remove(i)
80 |
81 | index_info = [i for i in index_info if i['play_url'][0:13]=='http://txmov2']
82 |
83 |
84 |
85 | context = {'filmlist':index_info}
86 |
87 | p.terminate()
88 |
89 | print('耗时:',time.time()-start)
90 |
91 |
92 | # return JsonResponse(context)
93 |
94 | return render(request, 'myks/index.html',context)#, context
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/myks/static/myks/css/base.css:
--------------------------------------------------------------------------------
1 | @charset "UTF-8";
2 | /*css 初始化 */
3 | html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img {
4 | margin: 0;
5 | padding: 0;
6 | box-sizing: border-box;
7 | /* 禁止滚动条 */
8 | touch-action: pan-y;
9 | }
10 |
11 | /*各浏览器显示不同,去掉蓝色边框*/
12 | fieldset,
13 | img,
14 | input,
15 | button {
16 | border: none;
17 | padding: 0;
18 | margin: 0;
19 | outline-style: none;
20 | }
21 |
22 | ul,
23 | ol {
24 | list-style: none;
25 | }
26 |
27 | input {
28 | padding-top: 0;
29 | padding-bottom: 0;
30 | font-family: "SimSun", "宋体";
31 | }
32 |
33 | /*去掉行内替换元素空白缝隙*/
34 | select,
35 | input {
36 | vertical-align: middle;
37 | }
38 |
39 | /*去掉行内替换元素空白缝隙*/
40 | img {
41 | border: 0;
42 | vertical-align: middle;
43 | }
44 |
45 | select,
46 | input,
47 | textarea {
48 | font-size: 12px;
49 | margin: 0;
50 | }
51 |
52 | /*防止拖动 影响布局*/
53 | textarea {
54 | resize: none;
55 | }
56 |
57 | table {
58 | border-collapse: collapse;
59 | }
60 |
61 | body {
62 | font: 12px/1.5 tahoma, arial, "Hiragino Sans GB", "\5b8b\4f53", sans-serif; /*宋体 unicode */
63 | color: #4c4c4c;
64 | background: #ffffff;
65 | }
66 |
67 | /*清除浮动*/
68 | .clearfix:before,
69 | .clearfix:after {
70 | content: "";
71 | display: table;
72 | }
73 |
74 | .clearfix:after {
75 | clear: both;
76 | }
77 | .clearfix:after {
78 | content: "";
79 | display: block;
80 | clear: both;
81 | height: 0;
82 | visibility: hidden;
83 | }
84 | .clearfix {
85 | *zoom: 1; /*IE/7/6*/
86 | }
87 |
88 | a {
89 | color: #3c3c3cff;
90 | text-decoration: none;
91 | }
92 |
93 | /* a:hover {
94 | color: #f40;
95 | } */
96 |
97 | h1,
98 | h2,
99 | h3,
100 | h4,
101 | h5,
102 | h6 {
103 | text-decoration: none;
104 | font-weight: normal;
105 | font-size: 100%;
106 | }
107 |
108 | s,
109 | i,
110 | em {
111 | font-style: normal;
112 | text-decoration: none;
113 | }
114 |
115 | /*公共类*/
116 | .w {
117 | /*版心 提取 */
118 | width: 1210px;
119 | margin: 0 auto;
120 | }
121 |
122 | .fl {
123 | float: left;
124 | }
125 |
126 | .fr {
127 | float: right;
128 | }
129 |
130 | .al {
131 | text-align: left;
132 | }
133 |
134 | .ac {
135 | text-align: center;
136 | }
137 |
138 | .ar {
139 | text-align: right;
140 | }
141 |
142 | .hide {
143 | display: none;
144 | }
145 |
--------------------------------------------------------------------------------
/myks/static/myks/css/index.css:
--------------------------------------------------------------------------------
1 | @import 'fonts.css';
2 | body {
3 | left: 0;
4 | right: 0;
5 | top: 0;
6 | bottom: 0;
7 | }
8 | body section {
9 | position: absolute;
10 | left: 0;
11 | right: 0;
12 | top: 0;
13 | bottom: 0;
14 | margin: auto;
15 | }
16 | body section .wrap {
17 | width: 14rem;
18 | height: 16rem;
19 | position: absolute;
20 | left: 0;
21 | right: 0;
22 | top: 0;
23 | bottom: 0;
24 | margin: auto;
25 | /*logo*/
26 | /*搜索框*/
27 | /* 引导 */
28 | }
29 | body section .wrap .logo {
30 | width: 100%;
31 | margin-bottom: 2rem;
32 | }
33 | body section .wrap .logo a {
34 | display: block;
35 | height: 3rem;
36 | text-align: center;
37 | font-size: 1rem;
38 | line-height: 3rem;
39 | background: url(../img/logo.png) no-repeat;
40 | background-position: center center;
41 | background-size: contain;
42 | }
43 | body section .wrap .search {
44 | width: 100%;
45 | padding: .2rem .1rem;
46 | }
47 | body section .wrap .search form {
48 | width: 100%;
49 | height: 100%;
50 | border-radius: 1.152rem;
51 | border: 1px solid #ffffff;
52 | transition: 0.2s box-shadow;
53 | }
54 | body section .wrap .search form input.search-inp {
55 | float: left;
56 | box-sizing: border-box;
57 | width: 76%;
58 | height: 1.984rem;
59 | font-size: 0.707407rem;
60 | color: #fff;
61 | background: #ff8d1b;
62 | padding: 0.42666667rem 0.512rem;
63 | border-radius: 1.152rem 0 0 1.152rem;
64 | }
65 | body section .wrap .search form input.search-inp::-webkit-input-placeholder {
66 | /* placeholder颜色 */
67 | color: #fbfbfbce;
68 | /* placeholder字体大小 */
69 | font-size: 12px;
70 | /* placeholder位置 */
71 | text-align: left;
72 | }
73 | body section .wrap .search form button.search-btn {
74 | float: left;
75 | width: 24%;
76 | height: 1.984rem;
77 | background: #181717;
78 | color: #fff;
79 | font-size: 0.64740741rem;
80 | border-radius: 0 1.152rem 1.152rem 0;
81 | }
82 | body section .wrap .guide {
83 | width: 7rem;
84 | height: 2rem;
85 | background: #ff8d1b;
86 | position: relative;
87 | border-radius: 50px;
88 | margin: 2.4rem auto 0;
89 | text-align: center;
90 | line-height: 2rem;
91 | font-size: 0.61866667rem;
92 | transition: all .6s;
93 | }
94 | body section .wrap .guide .round {
95 | display: block;
96 | color: #fff;
97 | width: 100%;
98 | height: 100%;
99 | }
100 |
--------------------------------------------------------------------------------
/myks/static/myks/css/video.less:
--------------------------------------------------------------------------------
1 | @import './fonts.css';
2 | @import './same.less';
3 | @rem: 750/16rem;
4 | body{
5 | background: #EFF0F3;
6 | .header()
7 | }
8 | // 导航
9 | .head-nav{
10 | height: 93/@rem;
11 | line-height: 93/@rem;
12 | padding-left: 21/@rem;
13 | background: #fff;
14 | // margin-bottom: 39/@rem;
15 | .video-name{
16 | font-size: 39/@rem;
17 | color: #3B4858;
18 | }
19 | }
20 | // 视频内容
21 | section{
22 | .video{
23 | background: #fff;
24 | width: 100%;
25 | height: 440/@rem;
26 | video{
27 | height: 100%;
28 | }
29 | }
30 | // 反馈
31 | .feedback{
32 | display: flex;
33 | justify-content: space-evenly;
34 | box-sizing: border-box;
35 | background: #fff;
36 | margin-bottom: 40/@rem;
37 | .feedback-l{
38 | text-align: center;
39 | padding: 35/@rem 0;
40 | &>span.feedback-num{
41 | display: block;
42 | color: #fff;
43 | width: 80/@rem;
44 | height: 80/@rem;
45 | line-height: 80/@rem;
46 | font-size: 26/@rem;
47 | border-radius: 50%;
48 | background: #3198f3;
49 | margin-right: 20/@rem;
50 | }
51 | }
52 | .feedback-r{
53 | text-align: center;
54 | padding: 35/@rem 0;
55 | &>span.feedback-num{
56 | display: block;
57 | color: #fff;
58 | width: 80/@rem;
59 | height: 80/@rem;
60 | line-height: 80/@rem;
61 | font-size: 26/@rem;
62 | border-radius: 50%;
63 | background: #3198f3;
64 | margin-right: 20/@rem;
65 | }
66 | }
67 | }
68 | // 剧集
69 | .episodes{
70 | box-sizing: border-box;
71 | height: 93/@rem;
72 | padding: 10/@rem 0;
73 | padding-left: 21/@rem;
74 | background: #fff;
75 | margin-bottom: 40/@rem;
76 | span{
77 | // float: left;
78 | display: inline-block;
79 | width: 90/@rem;
80 | height: 70/@rem;
81 | font-size: 26/@rem;
82 | color: #3B4858;
83 | border: 1px solid #fff;
84 | border-radius: 26%;
85 | background: #ffa954;
86 | a{
87 | display: block;
88 | width: 100%;
89 | height: 100%;
90 | color: #fff;
91 | line-height: 70/@rem;
92 | text-align: center;
93 | }
94 | }
95 | }
96 | // 内容简介
97 | .cont-jianj{
98 | background: #fff;
99 | padding-left: 42/@rem;
100 | color: #4C3A4A;
101 | p{
102 | height: 98/@rem;
103 | line-height: 98/@rem;
104 | font-size: 44/@rem;
105 | border-bottom: 1px solid #f1f1f1;
106 | }
107 | .cont-text{
108 | padding-top: 39/@rem;
109 | font-size: 38/@rem;
110 | text-indent: 60/@rem;
111 | }
112 | }
113 | }
--------------------------------------------------------------------------------
/myks/static/myks/css/index.less:
--------------------------------------------------------------------------------
1 | @import './fonts.css';
2 | @rem: 750/16rem;
3 | body{
4 | left: 0;
5 | right: 0;
6 | top: 0;
7 | bottom: 0;
8 | section{
9 | position: absolute;
10 | left: 0;
11 | right: 0;
12 | top: 0;
13 | bottom: 0;
14 | margin: auto;
15 | .wrap{
16 | width: 14rem;
17 | height: 16rem;
18 | position: absolute;
19 | left: 0;
20 | right: 0;
21 | top: 0;
22 | bottom: 0;
23 | margin: auto;
24 | /*logo*/
25 | .logo{
26 | width: 100%;
27 | margin-bottom: 2rem;
28 | a{
29 | display: block;
30 | height: 3rem;
31 | text-align: center;
32 | font-size: 1rem;
33 | line-height: 3rem;
34 | background: url(../img/logo.png) no-repeat;
35 | background-position: center center;
36 | background-size: contain;
37 | }
38 | }
39 | /*搜索框*/
40 | .search{
41 | width: 100%;
42 | padding: .2rem .1rem;
43 | form{
44 | width: 100%;
45 | height: 100%;
46 | border-radius: 54/@rem;
47 | border: 1px solid rgb(255, 255, 255);
48 | transition: .2s box-shadow;
49 | input.search-inp{
50 | float: left;
51 | box-sizing: border-box;
52 | width: 76%;
53 | height: 93/@rem;
54 | font-size: 0.707407rem;
55 | color: #fff;
56 | background: #ff8d1b;
57 | padding: 20/@rem 24/@rem;
58 | border-radius: 54/@rem 0 0 54/@rem;
59 | &::-webkit-input-placeholder {
60 | /* placeholder颜色 */
61 | color: #fbfbfbce;
62 | /* placeholder字体大小 */
63 | font-size: 12px;
64 | /* placeholder位置 */
65 | text-align: left;
66 | }
67 | }
68 | button.search-btn{
69 | float: left;
70 | width: 24%;
71 | height: 93/@rem;
72 | background: #181717;
73 | color: #fff;
74 | font-size: 0.64740741rem;
75 | border-radius: 0 54/@rem 54/@rem 0;
76 | }
77 | }
78 | }
79 | /* 引导 */
80 | .guide{
81 | width: 7rem;
82 | height: 2rem;
83 | background: #ff8d1b;
84 | position: relative;
85 | border-radius: 50px;
86 | margin: 2.4rem auto 0;
87 | text-align: center;
88 | line-height: 2rem;
89 | font-size: 29/@rem;
90 | transition: all .6s;
91 |
92 | // &::after{
93 | // content: '';
94 | // width:0;
95 | // height:0;
96 | // border-width:60/@rem 30/@rem 60/@rem 150/@rem;
97 | // border-style:solid;
98 | // border-color:transparent transparent transparent #222020;/*透明 灰 透明 透明 */
99 | // position: absolute;
100 | // top:-10/@rem;
101 | // right: -160/@rem;
102 | // }
103 | .round{
104 | display: block;
105 | color: #fff;
106 | width: 100%;
107 | height: 100%;
108 | }
109 | }
110 | }
111 | }
112 | }
113 |
114 | // .carousel-wrap >
115 | // .carousel-wrap >.list >li >a, .carousel-wrap >.list >li >a >img{
116 | // display: block;
117 | // }
118 |
--------------------------------------------------------------------------------
/ks/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for ks project.
3 |
4 | Generated by 'django-admin startproject' using Django 2.2.2.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/2.2/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/2.2/ref/settings/
11 | """
12 |
13 | import os
14 |
15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 |
18 |
19 | # Quick-start development settings - unsuitable for production
20 | # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
21 |
22 | # SECURITY WARNING: keep the secret key used in production secret!
23 | SECRET_KEY = 'yb*x$%14^$9_ggr=h2&6l@^we8+7rkvt!u+e6&vzzxwlv2k$84'
24 |
25 | # SECURITY WARNING: don't run with debug turned on in production!
26 | DEBUG = True
27 |
28 | ALLOWED_HOSTS = ['*',]
29 |
30 |
31 | # Application definition
32 |
33 | INSTALLED_APPS = [
34 | 'myks',
35 | 'django.contrib.admin',
36 | 'django.contrib.auth',
37 | 'django.contrib.contenttypes',
38 | 'django.contrib.sessions',
39 | 'django.contrib.messages',
40 | 'django.contrib.staticfiles',
41 | ]
42 |
43 | MIDDLEWARE = [
44 | 'django.middleware.security.SecurityMiddleware',
45 | 'django.contrib.sessions.middleware.SessionMiddleware',
46 | 'django.middleware.common.CommonMiddleware',
47 | 'django.middleware.csrf.CsrfViewMiddleware',
48 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
49 | 'django.contrib.messages.middleware.MessageMiddleware',
50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
51 | ]
52 |
53 | ROOT_URLCONF = 'ks.urls'
54 |
55 | TEMPLATES = [
56 | {
57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
58 | 'DIRS': [],
59 | 'APP_DIRS': True,
60 | 'OPTIONS': {
61 | 'context_processors': [
62 | 'django.template.context_processors.debug',
63 | 'django.template.context_processors.request',
64 | 'django.contrib.auth.context_processors.auth',
65 | 'django.contrib.messages.context_processors.messages',
66 | ],
67 | },
68 | },
69 | ]
70 |
71 | WSGI_APPLICATION = 'ks.wsgi.application'
72 |
73 |
74 | # Database
75 | # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
76 |
77 | DATABASES = {
78 | 'default': {
79 | 'ENGINE': 'django.db.backends.sqlite3',
80 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
81 | }
82 | }
83 |
84 |
85 | # Password validation
86 | # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
87 |
88 | AUTH_PASSWORD_VALIDATORS = [
89 | {
90 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
91 | },
92 | {
93 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
94 | },
95 | {
96 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
97 | },
98 | {
99 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
100 | },
101 | ]
102 |
103 |
104 | # Internationalization
105 | # https://docs.djangoproject.com/en/2.2/topics/i18n/
106 |
107 | LANGUAGE_CODE = 'zh-Hans'
108 |
109 | TIME_ZONE = 'Asia/Shanghai'
110 |
111 | USE_I18N = True
112 |
113 | USE_L10N = True
114 |
115 | USE_TZ = False
116 |
117 |
118 | # Static files (CSS, JavaScript, Images)
119 | # https://docs.djangoproject.com/en/2.2/howto/static-files/
120 |
121 | STATIC_URL = '/static/'
122 |
--------------------------------------------------------------------------------
/myks/static/myks/fonts/iconfont.css:
--------------------------------------------------------------------------------
1 | @font-face {font-family: "iconfont";
2 | src: url('iconfont.eot?t=1557318871629'); /* IE9 */
3 | src: url('iconfont.eot?t=1557318871629#iefix') format('embedded-opentype'), /* IE6-IE8 */
4 | url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAApwAAsAAAAAE2gAAAoiAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEZgqWcJJoATYCJANICyYABCAFhG0HgVsbbxARVaw3JPs6gds04a7qJQZEbQ1mNTjA3eJQNP1bKG4zjsWd4n6eCQIah/cYiQgyMrHNaQ5lbWtgXFpUWvwppPl62vT33SX95A4JUYHUjKSmJIVGDDgqRnJAWmhJze9ahwqdEFIgVjGoOqk6UtevRgD83006+icwVmsJZiFMDuReHMjEgMqmUBoR7u5XABxIWJRBmkBAkbU0l/9DFCZCleTbATlgddfmoJD06MnIzQ00ThItjn8ZVhnUbv/n2qdlSSQxR+hN3mbn/7yl2beHOcICsAJUZYkg1E/xjlNE1TlVoVtV43Xt8bft3jCazgWp/SevhwBsCdQJKh9WqAQOGtMR2GZiol4DnEw7uiFHYB1YVsyrPZAVwrGWy9hNADaDvy8+QBIOSCwU5hvVDOXRMNhkvVfgTIhJY9RSYPUpYKsDBcQD9NafqwxngSvOeTi2LcOoALBE90iTg9FQCHRagdDWZ0kkUEKvscASK6yxwdb6D54d9jjgiBPOhEBYYrr2lP66xhUY4dRDgJH1kGBUPRQYXQ8NxqqHBRi7HpZgHMLq7LkgrOF5IGzg+SBs4QUQiReCsIMXgbCHF4NwgJeAcISXgnCCl4FwhlegC5eF9QLbPZKBGgewqBqAyUBphIUKltOnkdlUgdbYSURHcgm3FK4p88GTEq57TFzMQg4OfkmpCUlcrmtUApHMJ2ixPAnzsWZfLv9yQBS+JSgjLXWsnSBWfHd9ELbgv+cnBY9BNc7azbZRL9+OYGotdSj4Qb35QZSqdofLGUfZt250jFTXObfHKG2ObfPpnUx7ba3Fxcbp7Gy8vkrqQ615JxOrpW3MLku8vibZo9fXsW5zzHzfW6X/nUpdT+D9HBspDun3870dR528mYFtutZP7WVHQ8OVxYvQ4lnz6cnug4ApagIByudTXvJnwsjBGEFssN8oP8/vV53wp0L98U1fm9M+ef3dHOLoffZBL3LbicSgjpx01LgRTe7wsO5ZbrGT2WVCSBU03UDyVr0jpgAK7ZoRv38+qRph+pEnvrWQo4lQLiIiyXY9yO6+UDXRQIjlwwAL96YiydVhaBJqEjwiCLJ0HK45WyGkxaP4h/GWWsAWbGY7whfryPMuo7VnLFL9vmDvOwd8Sps5LhBQ7jZh/AMKzwbUr7L4yx4EJ2nC+PrbYmifmdLNN3fQxdkJ89b0e+083MbdmKz33PBfa6911LezbdWYzzZ11HvYDrrSF/Iea63ddQCYGtq21WQu17mbvEeepKqNtTRqjp1paEe3UBZCP6z9mM/1+ahHo2g2OKjL2yzLXR/BfQioN/nzeJZT3n1oc2AY13z89G4efuBtS247k4iRJw/ScZ3b3I7GGu71IEm1/ckpW0zlu4hKuY1EeDvbdufbs/Exy5FYbS0zTzSptYeCVh70jso9In2eMrYeL2i2R2O1RPQuB6Mnup2S2H42STXedcBskdTEUfXedyPlvG4HNl5mVc7y+Rq7a8e2WFXtxq3b4+bLQu2U69iehClAfmfk8lh2ASwcLmoaN+tp2//eqLaxMlmZs8yNYp3RtNfJ72O/J69nDU4SJQ3OcmZBik48eJkCRNOooC35LfYb1yloNVLVSnAyJVt9FhT8tQPPsc//FtL9xk/X2ELaP/8jKyoyz53eZbziOH/GYTwKnfrsUxeqBs85c3x23I+xC2ZQdfq8e9F7CK2/+VT6rMyTzZssHt5Un+nZ1FxIABmFeRiekRH+kLgHbjzZgVdz53IYx1pDXuaAOE8UGeuuPt0SBhZHT8L33lQGPZsJ/yb7lmUSfy/7/q+lilRTRFHRBp4jcK0et7i3A9+xqbAo0ZRUMu2mDcVFhKlDp6GlxNE/vmM4cfoJEUcndBwaYUKPZw/h/F01vn95PF2tYLQKHaOw7vCp04piVZc8w03Yc+PCw4pInVgfpRDOFs+C0BBc24a1k3WITNYaibIEOB1aITr9P3rDMjLCHjFO4B6Q6FvL0bhxIEfepZEjlqr5HuMg5/avkaEJ45HcwReninkOTLtiOY3V8LNTJQXd6pG8vESGFvBFxfwFNDaMaet5p41FIeW/HI2XCF2Ck5lE4OompqRSStzNKRCnihQSJ5LXaOXIxpekZvNtWmy5TLZTILkkCJWjW3El7Dsr7corG0A82aBjK3GSYBw3mp/+IiL1/rC2f+zMfZObJy37lfz0hFGD66hUKnm7pLfMle7qJdshYSGVWvJbwKjsdnRP0b5OM4fgVq/XissX9ULYXE+ZFW/xYtYBWYZOUcIpqwfmbRmQWzEPen86ObJ39YdKbnhk7nADtGDwe8H3GvkpF/bs9Tb89ISWqaB3T8AKhIbhIDI1GxVEHU439K79XpwrOkPDjw7vzxNJDagg8yIMH899xwih90AXRQXQe+4qQLjgPxcYux4ZkYG1arBkZysyICO7XtP1a1gxDakR5YUFmAU8m0LqddnJWUlDvpYk7UHfTnu3gp+sWuKb7IGJcbI0SnptBgbIpbvOu0tIyP9fubOjojJzMl3T2dyvL3UB4HzzDO8fznm0MJ1SDEabbe5Pk17oXjVTvWrEiO9NHUzfs2kp4SmhFgYdkLaNkoIUowOkScJVts+IpqEqbOpUTGVxAlfwB6wiVfuN1ws2HrBqv4q8Hi9tw9JxBo3pXU9m3VQSwSPYjX/4gO/Bd3u4ewMJgIP2DHrxYQvuyvUbgJVwSCt2X9PH2bGkZe7gYn86yFlEx8o904xgl1euYCTtGw6zKbB/tr1u6dGDMyQLgzUr4Zj69VecyWPg+BFGON7TT0WBKlQl/Bapi7wkpDJVAFPzLQD8l1ugFoLSKv+Jt6VG73HdBp1TcCZk9jG+1dRbbjlpI1B3GI3VvUDFZXNusYkrRzF4EbFTHjwbqMb/ppn44LWHDuKSlcOTcN3H940X9P+NA38Yk09/QQ7DJS/efCkA1sg6FBexKlD6Zoi6w/ZLzOxwradDOL5fABICxzpoPhSE1nJX1XD6JKwLzoH/Ybo9H9r36Gyvg3yPhEmsCGAKa8KTdXo8s8COdGaJNUXMljiyhe1wMw0coW2AWMsZEzjbxySO3KCqSr+FGunPmAWevklLZARntjSJaEM7Ih2xB1ceRcQG5ApszaTsrngQbvuMOvXCU8x41jv6YJmgzIrbujsk9DpmCHNdxahAeR7glk2Dfc8wem6xjpnB2nGW52o/Y1bzMDlA6lFEr2YD5KqtrZnUheNB4c8/o0698A2HPLd9Rx/sw4NSpuiQfOdSp0NOZecw15VISoGzt+cB3JLC3lrNYKx+XIt1zBiJleNMTkdTXd1seH949y8DbDF/qWs2EKZQaQSdwWSxOVxeznORS3tDSEsrSO8oQSbZHZ0ESV9JViWarQ5VOgoGqQ2uSek911RttKR31xiDjfaC4VR3o6NWxcrIKZhU+oFc2bEYBthka8EN7rSWKx+09fRoM9B5JPGBURmtrBdNJgA=') format('woff2'),
5 | url('iconfont.woff?t=1557318871629') format('woff'),
6 | url('iconfont.ttf?t=1557318871629') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
7 | url('iconfont.svg?t=1557318871629#iconfont') format('svg'); /* iOS 4.1- */
8 | }
9 |
10 | .iconfont {
11 | font-family: "iconfont" !important;
12 | font-size: 16px;
13 | font-style: normal;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
17 |
18 | .icon-fenxiang:before {
19 | content: "\e624";
20 | }
21 |
22 | .icon-fanhui:before {
23 | content: "\e625";
24 | }
25 |
26 | .icon-guanbi:before {
27 | content: "\e626";
28 | }
29 |
30 | .icon-bofang:before {
31 | content: "\e627";
32 | }
33 |
34 | .icon-kefu:before {
35 | content: "\e628";
36 | }
37 |
38 | .icon-shenfenzheng:before {
39 | content: "\e629";
40 | }
41 |
42 | .icon-quanping:before {
43 | content: "\e62a";
44 | }
45 |
46 | .icon-zanting:before {
47 | content: "\e62b";
48 | }
49 |
50 | .icon-shoucang:before {
51 | content: "\e62c";
52 | }
53 |
54 | .icon-jiantoushang:before {
55 | content: "\e62d";
56 | }
57 |
58 | .icon-jiantoushang1:before {
59 | content: "\e62e";
60 | }
61 |
62 | .icon-jiantouyou:before {
63 | content: "\e62f";
64 | }
65 |
66 | .icon-jiantouxia:before {
67 | content: "\e630";
68 | }
69 |
70 | .icon-wode:before {
71 | content: "\e631";
72 | }
73 |
74 | .icon-shouye:before {
75 | content: "\e632";
76 | }
77 |
78 | .icon-fenlei:before {
79 | content: "\e633";
80 | }
81 |
82 | .icon-sousuo:before {
83 | content: "\e634";
84 | }
85 |
86 | .icon-huanyihuan:before {
87 | content: "\e653";
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/myks/static/myks/css/classification.css:
--------------------------------------------------------------------------------
1 | @import 'fonts.css';
2 | .header {
3 | margin-bottom: 0.42666667rem;
4 | }
5 | .header .back {
6 | float: left;
7 | width: 15%;
8 | height: 1.344rem;
9 | padding: .2rem .1rem;
10 | }
11 | .header .back a {
12 | display: block;
13 | width: 100%;
14 | height: 100%;
15 | font-size: 0.74666667rem;
16 | text-align: center;
17 | line-height: 1.344rem;
18 | position: relative;
19 | left: 0.21333333rem;
20 | }
21 | .header .back::after {
22 | content: '';
23 | width: 0;
24 | height: 0;
25 | border-width: 0.29866667rem 0.64rem 0.29866667rem 0;
26 | border-style: solid;
27 | border-color: transparent #222020 transparent transparent;
28 | /*透明 灰 透明 透明 */
29 | position: absolute;
30 | top: 0.55466667rem;
31 | left: 0rem;
32 | }
33 | .header .search {
34 | float: right;
35 | width: 80%;
36 | padding: .2rem .1rem;
37 | }
38 | .header .search form {
39 | width: 100%;
40 | height: 100%;
41 | border-radius: 1.152rem;
42 | border: 1px solid #ffffff;
43 | transition: 0.2s box-shadow;
44 | }
45 | .header .search form input.search-inp {
46 | float: left;
47 | box-sizing: border-box;
48 | width: 76%;
49 | height: 1.344rem;
50 | font-size: 0.707407rem;
51 | color: #fff;
52 | background: #ff8d1b;
53 | padding: 0.42666667rem 0.512rem;
54 | border-radius: 1.152rem 0 0 1.152rem;
55 | }
56 | .header .search form input.search-inp::-webkit-input-placeholder {
57 | /* placeholder颜色 */
58 | color: #f4f4f5cc;
59 | /* placeholder字体大小 */
60 | font-size: 12px;
61 | /* placeholder位置 */
62 | text-align: left;
63 | }
64 | .header .search form button.search-btn {
65 | float: left;
66 | width: 24%;
67 | height: 1.344rem;
68 | background: #181717;
69 | color: #fff;
70 | font-size: 0.64740741rem;
71 | border-radius: 0 1.152rem 1.152rem 0;
72 | }
73 | body {
74 | margin-bottom: 0.42666667rem;
75 | }
76 | body .back {
77 | float: left;
78 | width: 15%;
79 | height: 1.344rem;
80 | padding: .2rem .1rem;
81 | }
82 | body .back a {
83 | display: block;
84 | width: 100%;
85 | height: 100%;
86 | font-size: 0.74666667rem;
87 | text-align: center;
88 | line-height: 1.344rem;
89 | position: relative;
90 | left: 0.21333333rem;
91 | }
92 | body .back::after {
93 | content: '';
94 | width: 0;
95 | height: 0;
96 | border-width: 0.29866667rem 0.64rem 0.29866667rem 0;
97 | border-style: solid;
98 | border-color: transparent #222020 transparent transparent;
99 | /*透明 灰 透明 透明 */
100 | position: absolute;
101 | top: 0.55466667rem;
102 | left: 0rem;
103 | }
104 | body .search {
105 | float: right;
106 | width: 80%;
107 | padding: .2rem .1rem;
108 | }
109 | body .search form {
110 | width: 100%;
111 | height: 100%;
112 | border-radius: 1.152rem;
113 | border: 1px solid #ffffff;
114 | transition: 0.2s box-shadow;
115 | }
116 | body .search form input.search-inp {
117 | float: left;
118 | box-sizing: border-box;
119 | width: 76%;
120 | height: 1.344rem;
121 | font-size: 0.707407rem;
122 | color: #fff;
123 | background: #ff8d1b;
124 | padding: 0.42666667rem 0.512rem;
125 | border-radius: 1.152rem 0 0 1.152rem;
126 | }
127 | body .search form input.search-inp::-webkit-input-placeholder {
128 | /* placeholder颜色 */
129 | color: #f4f4f5cc;
130 | /* placeholder字体大小 */
131 | font-size: 12px;
132 | /* placeholder位置 */
133 | text-align: left;
134 | }
135 | body .search form button.search-btn {
136 | float: left;
137 | width: 24%;
138 | height: 1.344rem;
139 | background: #181717;
140 | color: #fff;
141 | font-size: 0.64740741rem;
142 | border-radius: 0 1.152rem 1.152rem 0;
143 | }
144 | .wrap .movie-plate .plate-head {
145 | display: flex;
146 | height: 1.3rem;
147 | padding: 0.3rem 1.1rem;
148 | border-bottom: 1px #f4f4f4 solid;
149 | }
150 | .wrap .movie-plate .plate-head a {
151 | font: 0.9rem/1.3rem sans-serif;
152 | font-weight: bold;
153 | }
154 | .wrap .movie-plate .plate-head a.movie-t {
155 | flex: 2;
156 | }
157 | .wrap .movie-plate .plate-head a.more-t {
158 | flex: 3;
159 | text-align: right;
160 | font-size: 0.6rem;
161 | font-weight: 500;
162 | color: #949999;
163 | }
164 | .wrap .movie-plate .movie-wrap {
165 | margin-top: .3rem;
166 | }
167 | .wrap .movie-plate .movie-wrap .movie-thumbnail .movie-row > li {
168 | float: left;
169 | width: 32%;
170 | height: 10rem;
171 | padding: .6rem .2rem;
172 | overflow: hidden;
173 | }
174 | .wrap .movie-plate .movie-wrap .movie-thumbnail .movie-row > li > a {
175 | display: block;
176 | width: 100%;
177 | border-top-left-radius: .8rem;
178 | border-top-right-radius: .8rem;
179 | }
180 | .wrap .movie-plate .movie-wrap .movie-thumbnail .movie-row > li > a img {
181 | height: 7rem;
182 | display: block;
183 | width: 100%;
184 | border-top-left-radius: .8rem;
185 | border-top-right-radius: .8rem;
186 | background: url(../img/loading.gif) no-repeat center;
187 | }
188 | .wrap .movie-plate .movie-wrap .movie-thumbnail .movie-row > li > a h3 {
189 | font: 0.6rem sans-serif;
190 | margin: 0.3rem 0;
191 | font-weight: bolder;
192 | white-space: nowrap;
193 | overflow: hidden;
194 | text-overflow: ellipsis;
195 | }
196 | .wrap .movie-plate .movie-wrap .movie-thumbnail .movie-row > li > a p {
197 | color: #949999;
198 | white-space: nowrap;
199 | overflow: hidden;
200 | text-overflow: ellipsis;
201 | }
202 |
--------------------------------------------------------------------------------
/myks/static/myks/css/search-list.css:
--------------------------------------------------------------------------------
1 | @import 'fonts.css';
2 | .header {
3 | margin-bottom: 0.42666667rem;
4 | }
5 | .header .back {
6 | float: left;
7 | width: 15%;
8 | height: 1.344rem;
9 | padding: .2rem .1rem;
10 | }
11 | .header .back a {
12 | display: block;
13 | width: 100%;
14 | height: 100%;
15 | font-size: 0.74666667rem;
16 | text-align: center;
17 | line-height: 1.344rem;
18 | position: relative;
19 | left: 0.21333333rem;
20 | }
21 | .header .back::after {
22 | content: '';
23 | width: 0;
24 | height: 0;
25 | border-width: 0.29866667rem 0.64rem 0.29866667rem 0;
26 | border-style: solid;
27 | border-color: transparent #222020 transparent transparent;
28 | /*透明 灰 透明 透明 */
29 | position: absolute;
30 | top: 0.55466667rem;
31 | left: 0rem;
32 | }
33 | .header .search {
34 | float: right;
35 | width: 80%;
36 | padding: .2rem .1rem;
37 | }
38 | .header .search form {
39 | width: 100%;
40 | height: 100%;
41 | border-radius: 1.152rem;
42 | border: 1px solid #ffffff;
43 | transition: 0.2s box-shadow;
44 | }
45 | .header .search form input.search-inp {
46 | float: left;
47 | box-sizing: border-box;
48 | width: 76%;
49 | height: 1.344rem;
50 | font-size: 0.707407rem;
51 | color: #fff;
52 | background: #ff8d1b;
53 | padding: 0.42666667rem 0.512rem;
54 | border-radius: 1.152rem 0 0 1.152rem;
55 | }
56 | .header .search form input.search-inp::-webkit-input-placeholder {
57 | /* placeholder颜色 */
58 | color: #fff;
59 | /* placeholder字体大小 */
60 | font-size: 12px;
61 | /* placeholder位置 */
62 | text-align: left;
63 | }
64 | .header .search form button.search-btn {
65 | float: left;
66 | width: 24%;
67 | height: 1.344rem;
68 | background: #181717;
69 | color: #fff;
70 | font-size: 0.64740741rem;
71 | border-radius: 0 1.152rem 1.152rem 0;
72 | }
73 | body {
74 | margin-bottom: 0.42666667rem;
75 | }
76 | body .back {
77 | float: left;
78 | width: 15%;
79 | height: 1.344rem;
80 | padding: .2rem .1rem;
81 | }
82 | body .back a {
83 | display: block;
84 | width: 100%;
85 | height: 100%;
86 | font-size: 0.74666667rem;
87 | text-align: center;
88 | line-height: 1.344rem;
89 | position: relative;
90 | left: 0.21333333rem;
91 | }
92 | body .back::after {
93 | content: '';
94 | width: 0;
95 | height: 0;
96 | border-width: 0.29866667rem 0.64rem 0.29866667rem 0;
97 | border-style: solid;
98 | border-color: transparent #222020 transparent transparent;
99 | /*透明 灰 透明 透明 */
100 | position: absolute;
101 | top: 0.55466667rem;
102 | left: 0rem;
103 | }
104 | body .search {
105 | float: right;
106 | width: 80%;
107 | padding: .2rem .1rem;
108 | }
109 | body .search form {
110 | width: 100%;
111 | height: 100%;
112 | border-radius: 1.152rem;
113 | border: 1px solid #ffffff;
114 | transition: 0.2s box-shadow;
115 | }
116 | body .search form input.search-inp {
117 | float: left;
118 | box-sizing: border-box;
119 | width: 76%;
120 | height: 1.344rem;
121 | font-size: 0.707407rem;
122 | color: #fff;
123 | background: #ff8d1b;
124 | padding: 0.42666667rem 0.512rem;
125 | border-radius: 1.152rem 0 0 1.152rem;
126 | }
127 | body .search form input.search-inp::-webkit-input-placeholder {
128 | /* placeholder颜色 */
129 | color: #aab2bd;
130 | /* placeholder字体大小 */
131 | font-size: 12px;
132 | /* placeholder位置 */
133 | text-align: right;
134 | }
135 | body .search form button.search-btn {
136 | float: left;
137 | width: 24%;
138 | height: 1.344rem;
139 | background: #181717;
140 | color: #fff;
141 | font-size: 0.64740741rem;
142 | border-radius: 0 1.152rem 1.152rem 0;
143 | }
144 | .search-stats .header {
145 | font-size: 0.66133333rem;
146 | height: 1.728rem;
147 | line-height: 1.728rem;
148 | text-align: center;
149 | color: #1c85d4;
150 | }
151 | .search-stats .line {
152 | width: 100%;
153 | height: 1px;
154 | background: #1c85d4;
155 | }
156 | .search-list {
157 | box-sizing: border-box;
158 | background: #f5f5f5;
159 | padding-top: 0.29866667rem;
160 | }
161 | .search-list .list-wrap li {
162 | box-sizing: border-box;
163 | background: #fff;
164 | padding: 0.192rem;
165 | margin-bottom: 0.40533333rem;
166 | border-radius: 0.42666667rem;
167 | box-shadow: 0.08533333rem 0.04266667rem 0.64rem 0.08533333rem rgba(0, 0, 0, 0.1);
168 | }
169 | .search-list .list-wrap li a {
170 | display: block;
171 | width: 100%;
172 | height: 6.784rem;
173 | }
174 | .search-list .list-wrap li a .left-box {
175 | float: left;
176 | width: 4.736rem;
177 | height: 6.784rem;
178 | }
179 | .search-list .list-wrap li a .left-box img {
180 | border-radius: 0.42666667rem;
181 | width: 100%;
182 | height: 100%;
183 | }
184 | .search-list .list-wrap li a .right-box {
185 | float: left;
186 | width: 8.53333333rem;
187 | margin-left: 0.49066667rem;
188 | }
189 | .search-list .list-wrap li a .right-box .video-title {
190 | box-sizing: border-box;
191 | font-size: 0.61866667rem;
192 | padding: 0.42666667rem 0;
193 | color: #1c85d4;
194 | text-align: left;
195 | font-weight: bold;
196 | }
197 | .search-list .list-wrap li a .right-box .cont {
198 | box-sizing: border-box;
199 | padding: 0.14933333rem 0;
200 | font-size: 0.55466667rem;
201 | }
202 | .search-list .list-wrap li a .right-box .cont .p {
203 | width: 100%;
204 | }
205 | .search-list .list-wrap li a .right-box .cont .p:nth-child(2) {
206 | width: 8.32rem;
207 | overflow: hidden;
208 | white-space: nowrap;
209 | text-overflow: ellipsis;
210 | }
211 | .search-list .list-wrap li a .right-box .cont .p .le {
212 | color: #3F4953;
213 | }
214 | .search-list .list-wrap li a .right-box .cont .p .ri {
215 | color: #7a8f25;
216 | overflow: hidden;
217 | }
218 | .search-list .list-wrap li a .right-box .cont .pt {
219 | margin-top: 0.17066667rem;
220 | }
221 |
--------------------------------------------------------------------------------
/myks/static/myks/js/carousel.js:
--------------------------------------------------------------------------------
1 | +(function (w) {
2 | w.zm = {};
3 | // 获取/设置 translate
4 | // 节点, 类型, 值
5 | w.zm.css = function (node, type, val) {
6 | if (typeof node === "object" && typeof node["transform"] === "undefined") {
7 | node["transform"] = {};
8 | }
9 |
10 | if (arguments.length >= 3) {
11 | //设置
12 | var text = "";
13 | node["transform"][type] = val;
14 |
15 | for (item in node["transform"]) {
16 | if (node["transform"].hasOwnProperty(item)) {
17 | switch (item) {
18 | case "translateX":
19 | case "translateY":
20 | text += item + "(" + node["transform"][item] + "px)";
21 | break;
22 | case "scale":
23 | text += item + "(" + node["transform"][item] + ")";
24 | break;
25 | case "rotate":
26 | text += item + "(" + node["transform"][item] + "deg)";
27 | break;
28 | }
29 | }
30 | }
31 | node.style.transform = node.style.webkitTransform = text;
32 | } else if (arguments.length == 2) {
33 | //读取
34 | val = node["transform"][type];
35 | if (typeof val === "undefined") {
36 | switch (type) {
37 | case "translateX":
38 | case "translateY":
39 | case "rotate":
40 | val = 0;
41 | break;
42 | case "scale":
43 | val = 1;
44 | break;
45 | }
46 | }
47 | return val;
48 | }
49 | }
50 | // arr ->图片数组
51 | w.zm.carousel = function (arr, time=2000) {
52 |
53 | /** carousel {arr} 生成结构 */
54 | /** @type {HTMLCanvasElement} */
55 | var carouselWrap = document.querySelector('.carousel-wrap');
56 | if (carouselWrap) {
57 | // 保存原始的小圆点个数
58 | var pointsLen = arr.length;
59 | // 无缝
60 | var needCarousel = carouselWrap.getAttribute('needCarousel');
61 | needCarousel = needCarousel == null ? false : true;
62 | if (needCarousel) {
63 | // 为实现无缝 复制一份数组
64 | arr = arr.concat(arr);
65 | }
66 |
67 | var ulN = document.createElement('ul');
68 | var styleN = document.createElement('style');
69 | ulN.classList.add('list')
70 | for (var i = 0; i < arr.length; i++) {
71 | ulN.innerHTML += '
'
72 | }
73 | styleN.innerHTML = '.carousel-wrap >.list >li{ width: '+ (1/arr.length*100) +'%;}.carousel-wrap > .list{ width: '+ (arr.length*100) +'%;}'
74 | carouselWrap.appendChild(ulN);
75 | document.head.appendChild(styleN);
76 |
77 | // carousel-wrap高度解决
78 | /** @type {HTMLCanvasElement} */
79 | var imgN = document.querySelector('.carousel-wrap >.list >li >a >img');
80 | setTimeout(function() {
81 | carouselWrap.style.height = imgN.offsetHeight + 'px';
82 | }, 100);
83 |
84 | // 判断是否有小圆点结构
85 | /** @type {HTMLCanvasElement} */
86 | var pointsWrap = document.querySelector('.carousel-wrap >.points-wrap');
87 | if (pointsWrap) {
88 |
89 | for (var i = 0; i < pointsLen; i++) {
90 | if (i == 0) {
91 | pointsWrap.innerHTML += '';
92 | }else {
93 | pointsWrap.innerHTML += '';
94 | }
95 | }
96 | /** @type {HTMLCanvasElement} */
97 | var points = document.querySelectorAll('.carousel-wrap >.points-wrap >span');
98 |
99 | }
100 | }
101 | var startX = 0; // 手指开始的位置
102 | var elementX = 0; // 元素开始的位置
103 | var translateX = 0;
104 | var index = 0; // 图片下标
105 | carouselWrap.addEventListener('touchstart', function (ev) {
106 | ev = ev || event
107 | var TouchC = ev.changedTouches[0];
108 | ulN.style.transition = 'none';
109 |
110 | // 无缝
111 | if (needCarousel) {
112 | // 点击第一组的第一张 跳到第二组的第一张
113 | // 点击第二组的最后一张 跳到第一组的最后一张
114 | // index代表ul的位置
115 | var index = zm.css(ulN, 'translateX') / document.documentElement.clientWidth
116 | if (-index === 0) {
117 | index = -pointsLen
118 | }else if (-index == arr.length - 1) {
119 | index = -(pointsLen - 1)
120 | }
121 | zm.css(ulN, 'translateX', index * document.documentElement.clientWidth)
122 | }
123 |
124 | startX = TouchC.clientX;
125 | elementX = zm.css(ulN, 'translateX');
126 | clearInterval(timer); // 关闭自动
127 | })
128 | carouselWrap.addEventListener('touchmove', function (ev) {
129 | ev = ev || event
130 | var TouchC = ev.changedTouches[0];
131 | var nowX = TouchC.clientX;
132 | var disX = nowX - startX; // 滑动的距离
133 | zm.css(ulN, 'translateX', elementX + disX)
134 | })
135 | carouselWrap.addEventListener('touchend', function (ev) {
136 | ev = ev || event
137 | // index 抽象了 ul 的实时位置
138 | index = zm.css(ulN, 'translateX') / document.documentElement.clientWidth
139 |
140 | index = Math.round(index); // 滑动一半
141 | // 超出控制
142 | index > 0 ? index = 0:false
143 | index < 1 - arr.length ? index = 1 - arr.length : false
144 | // 设置圆点
145 | setPoints(index)
146 |
147 | ulN.style.transition = '.6s transform';
148 | zm.css(ulN, 'translateX', index*(document.documentElement.clientWidth))
149 | if (needAuto) {
150 | auto() // 开启自动轮播
151 | }
152 | })
153 |
154 | /**
155 | * auto 自动轮播
156 | */
157 | var timer = 0;
158 | var needAuto = carouselWrap.getAttribute('needAuto');
159 | needAuto = needAuto == null ? false : true;
160 | if (needAuto) {
161 | auto()
162 | }
163 |
164 | function auto() {
165 | clearInterval(timer);
166 | timer = setInterval(function() {
167 | if (index == 1 - arr.length) {
168 | ulN.style.transition = 'none';
169 | index = 1 - arr.length/2;
170 | zm.css(ulN, 'translateX', index * document.documentElement.clientWidth)
171 | }
172 | setTimeout(function() {
173 | index--;
174 | ulN.style.transition = '1s transform';
175 | setPoints(index);
176 | zm.css(ulN, 'translateX', index * document.documentElement.clientWidth)
177 | }, 50);
178 | }, time);
179 | }
180 |
181 | /**
182 | * 圆点
183 | */
184 | function setPoints(index) {
185 | if (!pointsWrap) {
186 | return;
187 | }
188 | for (var i = 0; i < points.length; i++) {
189 | points[i].classList.remove('active');
190 | }
191 | points[-index % pointsLen].classList.add('active');
192 | }
193 |
194 | }
195 |
196 | })(window)
197 |
--------------------------------------------------------------------------------
/myks/static/myks/css/video.css:
--------------------------------------------------------------------------------
1 | @import 'fonts.css';
2 | .header {
3 | margin-bottom: 0.42666667rem;
4 | }
5 | .header .back {
6 | float: left;
7 | width: 15%;
8 | height: 1.344rem;
9 | padding: .2rem .1rem;
10 | }
11 | .header .back a {
12 | display: block;
13 | width: 100%;
14 | height: 100%;
15 | font-size: 0.74666667rem;
16 | text-align: center;
17 | line-height: 1.344rem;
18 | position: relative;
19 | left: 0.21333333rem;
20 | }
21 | .header .back::after {
22 | content: '';
23 | width: 0;
24 | height: 0;
25 | border-width: 0.29866667rem 0.64rem 0.29866667rem 0;
26 | border-style: solid;
27 | border-color: transparent #222020 transparent transparent;
28 | /*透明 灰 透明 透明 */
29 | position: absolute;
30 | top: 0.55466667rem;
31 | left: 0rem;
32 | }
33 | .header .search {
34 | float: right;
35 | width: 80%;
36 | padding: .2rem .1rem;
37 | }
38 | .header .search form {
39 | width: 100%;
40 | height: 100%;
41 | border-radius: 1.152rem;
42 | border: 1px solid #ffffff;
43 | transition: 0.2s box-shadow;
44 | }
45 | .header .search form input.search-inp {
46 | float: left;
47 | box-sizing: border-box;
48 | width: 76%;
49 | height: 1.344rem;
50 | font-size: 0.707407rem;
51 | color: #fff;
52 | background: #ff8d1b;
53 | padding: 0.42666667rem 0.512rem;
54 | border-radius: 1.152rem 0 0 1.152rem;
55 | }
56 | .header .search form input.search-inp::-webkit-input-placeholder {
57 | /* placeholder颜色 */
58 | color: #f4f4f5cc;
59 | /* placeholder字体大小 */
60 | font-size: 12px;
61 | /* placeholder位置 */
62 | text-align: left;
63 | }
64 | .header .search form button.search-btn {
65 | float: left;
66 | width: 24%;
67 | height: 1.344rem;
68 | background: #181717;
69 | color: #fff;
70 | font-size: 0.64740741rem;
71 | border-radius: 0 1.152rem 1.152rem 0;
72 | }
73 | body {
74 | background: #EFF0F3;
75 | margin-bottom: 0.42666667rem;
76 | }
77 | body .back {
78 | float: left;
79 | width: 15%;
80 | height: 1.344rem;
81 | padding: .2rem .1rem;
82 | }
83 | body .back a {
84 | display: block;
85 | width: 100%;
86 | height: 100%;
87 | font-size: 0.74666667rem;
88 | text-align: center;
89 | line-height: 1.344rem;
90 | position: relative;
91 | left: 0.21333333rem;
92 | }
93 | body .back::after {
94 | content: '';
95 | width: 0;
96 | height: 0;
97 | border-width: 0.29866667rem 0.64rem 0.29866667rem 0;
98 | border-style: solid;
99 | border-color: transparent #222020 transparent transparent;
100 | /*透明 灰 透明 透明 */
101 | position: absolute;
102 | top: 0.55466667rem;
103 | left: 0rem;
104 | }
105 | body .search {
106 | float: right;
107 | width: 80%;
108 | padding: .2rem .1rem;
109 | }
110 | body .search form {
111 | width: 100%;
112 | height: 100%;
113 | border-radius: 1.152rem;
114 | border: 1px solid #ffffff;
115 | transition: 0.2s box-shadow;
116 | }
117 | body .search form input.search-inp {
118 | float: left;
119 | box-sizing: border-box;
120 | width: 76%;
121 | height: 1.344rem;
122 | font-size: 0.707407rem;
123 | color: #fff;
124 | background: #ff8d1b;
125 | padding: 0.42666667rem 0.512rem;
126 | border-radius: 1.152rem 0 0 1.152rem;
127 | }
128 | body .search form input.search-inp::-webkit-input-placeholder {
129 | /* placeholder颜色 */
130 | color: #f4f4f5cc;
131 | /* placeholder字体大小 */
132 | font-size: 12px;
133 | /* placeholder位置 */
134 | text-align: left;
135 | }
136 | body .search form button.search-btn {
137 | float: left;
138 | width: 24%;
139 | height: 1.344rem;
140 | background: #181717;
141 | color: #fff;
142 | font-size: 0.64740741rem;
143 | border-radius: 0 1.152rem 1.152rem 0;
144 | }
145 | .head-nav {
146 | height: 1.984rem;
147 | line-height: 1.984rem;
148 | padding-left: 0.448rem;
149 | background: #fff;
150 | }
151 | .head-nav .video-name {
152 | font-size: 0.832rem;
153 | color: #3B4858;
154 | }
155 | section .video {
156 | background: #fff;
157 | width: 100%;
158 | height: 9.38666667rem;
159 | }
160 | section .video video {
161 | height: 100%;
162 | }
163 | section .feedback {
164 | display: flex;
165 | justify-content: space-evenly;
166 | box-sizing: border-box;
167 | background: #fff;
168 | margin-bottom: 0.85333333rem;
169 | }
170 | section .feedback .feedback-l {
171 | text-align: center;
172 | padding: 0.74666667rem 0;
173 | }
174 | section .feedback .feedback-l > span.feedback-num {
175 | display: block;
176 | color: #fff;
177 | width: 1.70666667rem;
178 | height: 1.70666667rem;
179 | line-height: 1.70666667rem;
180 | font-size: 0.55466667rem;
181 | border-radius: 50%;
182 | background: #3198f3;
183 | margin-right: 0.42666667rem;
184 | }
185 | section .feedback .feedback-r {
186 | text-align: center;
187 | padding: 0.74666667rem 0;
188 | }
189 | section .feedback .feedback-r > span.feedback-num {
190 | display: block;
191 | color: #fff;
192 | width: 1.70666667rem;
193 | height: 1.70666667rem;
194 | line-height: 1.70666667rem;
195 | font-size: 0.55466667rem;
196 | border-radius: 50%;
197 | background: #3198f3;
198 | margin-right: 0.42666667rem;
199 | }
200 | section .episodes {
201 | box-sizing: border-box;
202 | height: 1.984rem;
203 | padding: 0.21333333rem 0;
204 | padding-left: 0.448rem;
205 | background: #fff;
206 | margin-bottom: 0.85333333rem;
207 | }
208 | section .episodes span {
209 | display: inline-block;
210 | width: 1.92rem;
211 | height: 1.49333333rem;
212 | font-size: 0.55466667rem;
213 | color: #3B4858;
214 | border: 1px solid #fff;
215 | border-radius: 26%;
216 | background: #ffa954;
217 | }
218 | section .episodes span a {
219 | display: block;
220 | width: 100%;
221 | height: 100%;
222 | color: #fff;
223 | line-height: 1.49333333rem;
224 | text-align: center;
225 | }
226 | section .cont-jianj {
227 | background: #fff;
228 | padding-left: 0.896rem;
229 | color: #4C3A4A;
230 | }
231 | section .cont-jianj p {
232 | height: 2.09066667rem;
233 | line-height: 2.09066667rem;
234 | font-size: 0.93866667rem;
235 | border-bottom: 1px solid #f1f1f1;
236 | }
237 | section .cont-jianj .cont-text {
238 | padding-top: 0.832rem;
239 | font-size: 0.81066667rem;
240 | text-indent: 1.28rem;
241 | }
242 |
--------------------------------------------------------------------------------
/play_ks/ks_spider.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Tue Jun 18 09:11:53 2019
4 |
5 | @author: 一文 --最远的你们是我最近的爱
6 | """
7 | from spider import Spider
8 | from multiprocessing.dummy import Pool
9 | import jpype
10 | import os
11 | #from klh import kuaishou
12 |
13 |
14 | class Ks_spider:
15 |
16 |
17 | def __init__(self,javaClass):#初始化JVM,
18 |
19 | '''
20 | args: sig_ls 存储破解sig a
21 | arg_ls 存储data参数
22 | '''
23 | # jarpath = os.path.join(os.path.abspath("."), "E:\\ks\\play_ks\\")
24 | #
25 | # jvmPath = r'E:\Java\jre1.8.0_101\bin\server\jvm.dll'
26 | #
27 | # jpype.startJVM(jvmPath, "-ea","-Djava.class.path=%s" % (jarpath + 'ks_sig.jar'))
28 | #
29 | # self.javaClass = jpype.JClass("SingatureUtil")
30 |
31 | self.sig_ls = []
32 |
33 | self.t = javaClass()
34 |
35 | self.arg_ls = []
36 |
37 | self.arg = []
38 |
39 | def run(self,args):#破解快手sig码
40 |
41 | sig = self.t.run(args)
42 |
43 | return self.sig_ls.append(sig)
44 |
45 | def get_movies(self):#随机获取20个视频
46 |
47 | try:
48 |
49 | url = 'http://101.251.217.216/rest/n/feed/hot?isp=CMCC&mod=lemobile%28le%20x620%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&extId=59942a6c1d534a51844dfda37e92afc3&did=ANDROID_72c3ac6bd3184a67&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560736770695&ver=6.1&max_memory=192&type=7&page=1&coldStart=false&count=20&pv=false&id=23&refreshTimes=7&pcursor=&source=1&needInterestTag=false&client_key=3c2cd3f3&os=android&sig=510e56b366931c4cb008c51ee44664c2'
50 |
51 | return Spider().get_html(url)
52 |
53 | except Exception as e :
54 |
55 | print(e.args)
56 |
57 | def get_first_comment_data(self,info):#获取视频第一次不带pcursor参数的args
58 |
59 | datas = []
60 |
61 | for i in info['feeds'] :
62 |
63 | args = (i['photo_id'],i['user_id'])
64 |
65 | datas.append(args)
66 |
67 | s_sig_ls = []
68 |
69 | for i in datas:
70 |
71 | sig_l = 'isp=CMCC&mod=vivo%28vivo%20x5m%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_d1f47e9473209293&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560817030537&ver=6.1&retryTimes=1&max_memory=192'
72 |
73 | sig_r = '&photoId='+str(i[0])+'&user_id='+str(i[1])+'&order=desc&count=10&photoPageType=0&client_key=3c2cd3f3&os=android'
74 |
75 | s_sig_ls.append(sig_l+sig_r)
76 |
77 | for i in range(len(s_sig_ls)):
78 |
79 | print(i)
80 |
81 | sig = self.t.run(s_sig_ls[i])
82 |
83 | data = (datas[i][0],datas[i][1],sig.lower())
84 |
85 | self.arg_ls.append(data)
86 |
87 | return self.arg_ls
88 |
89 |
90 | def get_comment(self,args):#获取评论
91 |
92 | comment_url = 'http://api.gifshow.com/rest/n/comment/list/v2?isp=CMCC&mod=vivo%28vivo%20x5m%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_d1f47e9473209293&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560817030537&ver=6.1&retryTimes=1&max_memory=192'
93 |
94 | if len(args)==3:#获取作品的第一组评论
95 |
96 | sig_r = '&photoId={}&user_id={}&order=desc&count=10&photoPageType=0&client_key=3c2cd3f3&os=android&sig={}'.format(args[0],args[1],args[2])
97 |
98 | comment_url = comment_url + sig_r
99 |
100 | return Spider().get_html(comment_url)
101 |
102 | if len(args)==4:#获取带有pcursor参数的评论
103 |
104 | sig_r = '&photoId={}&user_id={}&order=desc&pcursor={}&count=10&photoPageType=0&client_key=3c2cd3f3&os=android&sig={}'.format(args[0],args[1],args[2],args[3])
105 |
106 | comment_url = comment_url + sig_r
107 |
108 | return Spider().get_html(comment_url)
109 |
110 | def comment_info(self,args):#多进程获取当前作品评论
111 |
112 | p = Pool(10)
113 |
114 | return p.map(self.get_comment,args)
115 |
116 | def get_all_comment_pro(self,args):
117 |
118 | if len(args)==3:#单个评论args参数
119 |
120 | info = self.get_comment(args)
121 |
122 | next_args = [(args[0],args[1],info['pcursor'])]
123 |
124 | else:#多个视频args参数列表
125 |
126 | p = Pool(10)
127 |
128 | info = p.map(self.get_comment,args)
129 |
130 | next_args = [(args[i][0],args[i][1],info[i]['pcursor'])for i in range(len(args))]
131 |
132 | s_sig_ls = []
133 |
134 | args_ls = []
135 |
136 | for i in next_args:
137 |
138 | sig_l = 'isp=CMCC&mod=vivo%28vivo%20x5m%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_d1f47e9473209293&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560817030537&ver=6.1&retryTimes=1&max_memory=192'
139 |
140 | sig_r = '&photoId='+str(i[0])+'&user_id='+str(i[1])+'&pcursor='+str(i[2])+'&order=desc&count=10&photoPageType=0&client_key=3c2cd3f3&os=android'
141 |
142 | s_sig_ls.append(sig_l+sig_r)
143 |
144 | for i in range(len(s_sig_ls)):
145 |
146 | print(i)
147 |
148 | sig = self.t.run(s_sig_ls[i])
149 |
150 | data = (next_args[i][0],next_args[i][1],next_args[i][2],sig.lower())
151 |
152 | args_ls.append(data)
153 |
154 | self.arg_ls.append(data)
155 |
156 | return args_ls
157 |
158 | def do_work(self,args):#构建评论参数队列
159 |
160 | while True:
161 |
162 | self.arg.append(args)
163 |
164 | args = self.get_all_comment_pro(args)
165 |
166 | for i in args:
167 |
168 | print(i)
169 |
170 | print('---------------------------')
171 |
172 | if i[2] == 'no_more':
173 |
174 | args.remove(i)
175 |
176 | if len(args) == 0:
177 |
178 | print('当前args长度',len(args))
179 |
180 | break
181 |
182 | def get_args(self,movies,userId):#通过用户ID获取用户当前作品的所有评论
183 |
184 | args = self.get_first_comment_data(movies)
185 |
186 | print(len(args))
187 |
188 | args = [i for i in args if i[1] == userId]
189 |
190 | queue = self.get_all_comment_pro(args)
191 |
192 | self.do_work(queue)
193 |
194 | args = [i[0] for i in self.arg]
195 |
196 | return self.comment_info(args)
197 |
198 | def close(self):
199 |
200 | jpype.shutdownJVM()
201 |
202 | print('关闭JVM')
203 |
204 |
205 |
206 |
207 | if __name__ == '__main__':
208 |
209 | x = Ks_spider()
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
--------------------------------------------------------------------------------
/myks/static/myks/fonts/demo.css:
--------------------------------------------------------------------------------
1 | /* Logo 字体 */
2 | @font-face {
3 | font-family: "iconfont logo";
4 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
5 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
6 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
7 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
8 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
9 | }
10 |
11 | .logo {
12 | font-family: "iconfont logo";
13 | font-size: 160px;
14 | font-style: normal;
15 | -webkit-font-smoothing: antialiased;
16 | -moz-osx-font-smoothing: grayscale;
17 | }
18 |
19 | /* tabs */
20 | .nav-tabs {
21 | position: relative;
22 | }
23 |
24 | .nav-tabs .nav-more {
25 | position: absolute;
26 | right: 0;
27 | bottom: 0;
28 | height: 42px;
29 | line-height: 42px;
30 | color: #666;
31 | }
32 |
33 | #tabs {
34 | border-bottom: 1px solid #eee;
35 | }
36 |
37 | #tabs li {
38 | cursor: pointer;
39 | width: 100px;
40 | height: 40px;
41 | line-height: 40px;
42 | text-align: center;
43 | font-size: 16px;
44 | border-bottom: 2px solid transparent;
45 | position: relative;
46 | z-index: 1;
47 | margin-bottom: -1px;
48 | color: #666;
49 | }
50 |
51 |
52 | #tabs .active {
53 | border-bottom-color: #f00;
54 | color: #222;
55 | }
56 |
57 | .tab-container .content {
58 | display: none;
59 | }
60 |
61 | /* 页面布局 */
62 | .main {
63 | padding: 30px 100px;
64 | width: 960px;
65 | margin: 0 auto;
66 | }
67 |
68 | .main .logo {
69 | color: #333;
70 | text-align: left;
71 | margin-bottom: 30px;
72 | line-height: 1;
73 | height: 110px;
74 | margin-top: -50px;
75 | overflow: hidden;
76 | *zoom: 1;
77 | }
78 |
79 | .main .logo a {
80 | font-size: 160px;
81 | color: #333;
82 | }
83 |
84 | .helps {
85 | margin-top: 40px;
86 | }
87 |
88 | .helps pre {
89 | padding: 20px;
90 | margin: 10px 0;
91 | border: solid 1px #e7e1cd;
92 | background-color: #fffdef;
93 | overflow: auto;
94 | }
95 |
96 | .icon_lists {
97 | width: 100% !important;
98 | overflow: hidden;
99 | *zoom: 1;
100 | }
101 |
102 | .icon_lists li {
103 | width: 100px;
104 | margin-bottom: 10px;
105 | margin-right: 20px;
106 | text-align: center;
107 | list-style: none !important;
108 | cursor: default;
109 | }
110 |
111 | .icon_lists li .code-name {
112 | line-height: 1.2;
113 | }
114 |
115 | .icon_lists .icon {
116 | display: block;
117 | height: 100px;
118 | line-height: 100px;
119 | font-size: 42px;
120 | margin: 10px auto;
121 | color: #333;
122 | -webkit-transition: font-size 0.25s linear, width 0.25s linear;
123 | -moz-transition: font-size 0.25s linear, width 0.25s linear;
124 | transition: font-size 0.25s linear, width 0.25s linear;
125 | }
126 |
127 | .icon_lists .icon:hover {
128 | font-size: 100px;
129 | }
130 |
131 | .icon_lists .svg-icon {
132 | /* 通过设置 font-size 来改变图标大小 */
133 | width: 1em;
134 | /* 图标和文字相邻时,垂直对齐 */
135 | vertical-align: -0.15em;
136 | /* 通过设置 color 来改变 SVG 的颜色/fill */
137 | fill: currentColor;
138 | /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
139 | normalize.css 中也包含这行 */
140 | overflow: hidden;
141 | }
142 |
143 | .icon_lists li .name,
144 | .icon_lists li .code-name {
145 | color: #666;
146 | }
147 |
148 | /* markdown 样式 */
149 | .markdown {
150 | color: #666;
151 | font-size: 14px;
152 | line-height: 1.8;
153 | }
154 |
155 | .highlight {
156 | line-height: 1.5;
157 | }
158 |
159 | .markdown img {
160 | vertical-align: middle;
161 | max-width: 100%;
162 | }
163 |
164 | .markdown h1 {
165 | color: #404040;
166 | font-weight: 500;
167 | line-height: 40px;
168 | margin-bottom: 24px;
169 | }
170 |
171 | .markdown h2,
172 | .markdown h3,
173 | .markdown h4,
174 | .markdown h5,
175 | .markdown h6 {
176 | color: #404040;
177 | margin: 1.6em 0 0.6em 0;
178 | font-weight: 500;
179 | clear: both;
180 | }
181 |
182 | .markdown h1 {
183 | font-size: 28px;
184 | }
185 |
186 | .markdown h2 {
187 | font-size: 22px;
188 | }
189 |
190 | .markdown h3 {
191 | font-size: 16px;
192 | }
193 |
194 | .markdown h4 {
195 | font-size: 14px;
196 | }
197 |
198 | .markdown h5 {
199 | font-size: 12px;
200 | }
201 |
202 | .markdown h6 {
203 | font-size: 12px;
204 | }
205 |
206 | .markdown hr {
207 | height: 1px;
208 | border: 0;
209 | background: #e9e9e9;
210 | margin: 16px 0;
211 | clear: both;
212 | }
213 |
214 | .markdown p {
215 | margin: 1em 0;
216 | }
217 |
218 | .markdown>p,
219 | .markdown>blockquote,
220 | .markdown>.highlight,
221 | .markdown>ol,
222 | .markdown>ul {
223 | width: 80%;
224 | }
225 |
226 | .markdown ul>li {
227 | list-style: circle;
228 | }
229 |
230 | .markdown>ul li,
231 | .markdown blockquote ul>li {
232 | margin-left: 20px;
233 | padding-left: 4px;
234 | }
235 |
236 | .markdown>ul li p,
237 | .markdown>ol li p {
238 | margin: 0.6em 0;
239 | }
240 |
241 | .markdown ol>li {
242 | list-style: decimal;
243 | }
244 |
245 | .markdown>ol li,
246 | .markdown blockquote ol>li {
247 | margin-left: 20px;
248 | padding-left: 4px;
249 | }
250 |
251 | .markdown code {
252 | margin: 0 3px;
253 | padding: 0 5px;
254 | background: #eee;
255 | border-radius: 3px;
256 | }
257 |
258 | .markdown strong,
259 | .markdown b {
260 | font-weight: 600;
261 | }
262 |
263 | .markdown>table {
264 | border-collapse: collapse;
265 | border-spacing: 0px;
266 | empty-cells: show;
267 | border: 1px solid #e9e9e9;
268 | width: 95%;
269 | margin-bottom: 24px;
270 | }
271 |
272 | .markdown>table th {
273 | white-space: nowrap;
274 | color: #333;
275 | font-weight: 600;
276 | }
277 |
278 | .markdown>table th,
279 | .markdown>table td {
280 | border: 1px solid #e9e9e9;
281 | padding: 8px 16px;
282 | text-align: left;
283 | }
284 |
285 | .markdown>table th {
286 | background: #F7F7F7;
287 | }
288 |
289 | .markdown blockquote {
290 | font-size: 90%;
291 | color: #999;
292 | border-left: 4px solid #e9e9e9;
293 | padding-left: 0.8em;
294 | margin: 1em 0;
295 | }
296 |
297 | .markdown blockquote p {
298 | margin: 0;
299 | }
300 |
301 | .markdown .anchor {
302 | opacity: 0;
303 | transition: opacity 0.3s ease;
304 | margin-left: 8px;
305 | }
306 |
307 | .markdown .waiting {
308 | color: #ccc;
309 | }
310 |
311 | .markdown h1:hover .anchor,
312 | .markdown h2:hover .anchor,
313 | .markdown h3:hover .anchor,
314 | .markdown h4:hover .anchor,
315 | .markdown h5:hover .anchor,
316 | .markdown h6:hover .anchor {
317 | opacity: 1;
318 | display: inline-block;
319 | }
320 |
321 | .markdown>br,
322 | .markdown>p>br {
323 | clear: both;
324 | }
325 |
326 |
327 | .hljs {
328 | display: block;
329 | background: white;
330 | padding: 0.5em;
331 | color: #333333;
332 | overflow-x: auto;
333 | }
334 |
335 | .hljs-comment,
336 | .hljs-meta {
337 | color: #969896;
338 | }
339 |
340 | .hljs-string,
341 | .hljs-variable,
342 | .hljs-template-variable,
343 | .hljs-strong,
344 | .hljs-emphasis,
345 | .hljs-quote {
346 | color: #df5000;
347 | }
348 |
349 | .hljs-keyword,
350 | .hljs-selector-tag,
351 | .hljs-type {
352 | color: #a71d5d;
353 | }
354 |
355 | .hljs-literal,
356 | .hljs-symbol,
357 | .hljs-bullet,
358 | .hljs-attribute {
359 | color: #0086b3;
360 | }
361 |
362 | .hljs-section,
363 | .hljs-name {
364 | color: #63a35c;
365 | }
366 |
367 | .hljs-tag {
368 | color: #333333;
369 | }
370 |
371 | .hljs-title,
372 | .hljs-attr,
373 | .hljs-selector-id,
374 | .hljs-selector-class,
375 | .hljs-selector-attr,
376 | .hljs-selector-pseudo {
377 | color: #795da3;
378 | }
379 |
380 | .hljs-addition {
381 | color: #55a532;
382 | background-color: #eaffea;
383 | }
384 |
385 | .hljs-deletion {
386 | color: #bd2c00;
387 | background-color: #ffecec;
388 | }
389 |
390 | .hljs-link {
391 | text-decoration: underline;
392 | }
393 |
394 | /* 代码高亮 */
395 | /* PrismJS 1.15.0
396 | https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
397 | /**
398 | * prism.js default theme for JavaScript, CSS and HTML
399 | * Based on dabblet (http://dabblet.com)
400 | * @author Lea Verou
401 | */
402 | code[class*="language-"],
403 | pre[class*="language-"] {
404 | color: black;
405 | background: none;
406 | text-shadow: 0 1px white;
407 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
408 | text-align: left;
409 | white-space: pre;
410 | word-spacing: normal;
411 | word-break: normal;
412 | word-wrap: normal;
413 | line-height: 1.5;
414 |
415 | -moz-tab-size: 4;
416 | -o-tab-size: 4;
417 | tab-size: 4;
418 |
419 | -webkit-hyphens: none;
420 | -moz-hyphens: none;
421 | -ms-hyphens: none;
422 | hyphens: none;
423 | }
424 |
425 | pre[class*="language-"]::-moz-selection,
426 | pre[class*="language-"] ::-moz-selection,
427 | code[class*="language-"]::-moz-selection,
428 | code[class*="language-"] ::-moz-selection {
429 | text-shadow: none;
430 | background: #b3d4fc;
431 | }
432 |
433 | pre[class*="language-"]::selection,
434 | pre[class*="language-"] ::selection,
435 | code[class*="language-"]::selection,
436 | code[class*="language-"] ::selection {
437 | text-shadow: none;
438 | background: #b3d4fc;
439 | }
440 |
441 | @media print {
442 |
443 | code[class*="language-"],
444 | pre[class*="language-"] {
445 | text-shadow: none;
446 | }
447 | }
448 |
449 | /* Code blocks */
450 | pre[class*="language-"] {
451 | padding: 1em;
452 | margin: .5em 0;
453 | overflow: auto;
454 | }
455 |
456 | :not(pre)>code[class*="language-"],
457 | pre[class*="language-"] {
458 | background: #f5f2f0;
459 | }
460 |
461 | /* Inline code */
462 | :not(pre)>code[class*="language-"] {
463 | padding: .1em;
464 | border-radius: .3em;
465 | white-space: normal;
466 | }
467 |
468 | .token.comment,
469 | .token.prolog,
470 | .token.doctype,
471 | .token.cdata {
472 | color: slategray;
473 | }
474 |
475 | .token.punctuation {
476 | color: #999;
477 | }
478 |
479 | .namespace {
480 | opacity: .7;
481 | }
482 |
483 | .token.property,
484 | .token.tag,
485 | .token.boolean,
486 | .token.number,
487 | .token.constant,
488 | .token.symbol,
489 | .token.deleted {
490 | color: #905;
491 | }
492 |
493 | .token.selector,
494 | .token.attr-name,
495 | .token.string,
496 | .token.char,
497 | .token.builtin,
498 | .token.inserted {
499 | color: #690;
500 | }
501 |
502 | .token.operator,
503 | .token.entity,
504 | .token.url,
505 | .language-css .token.string,
506 | .style .token.string {
507 | color: #9a6e3a;
508 | background: hsla(0, 0%, 100%, .5);
509 | }
510 |
511 | .token.atrule,
512 | .token.attr-value,
513 | .token.keyword {
514 | color: #07a;
515 | }
516 |
517 | .token.function,
518 | .token.class-name {
519 | color: #DD4A68;
520 | }
521 |
522 | .token.regex,
523 | .token.important,
524 | .token.variable {
525 | color: #e90;
526 | }
527 |
528 | .token.important,
529 | .token.bold {
530 | font-weight: bold;
531 | }
532 |
533 | .token.italic {
534 | font-style: italic;
535 | }
536 |
537 | .token.entity {
538 | cursor: help;
539 | }
540 |
--------------------------------------------------------------------------------
/play_ks/klh.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Tue Jun 18 09:19:59 2019
4 |
5 | @author: lenovo
6 | """
7 |
8 | import requests
9 | import os
10 | import jpype
11 | from spider import Spider
12 | from multiprocessing.dummy import Pool
13 | import time
14 |
15 | class kuaishou:
16 |
17 | def __init__(self,javaClass): #初始化Java虚拟机参数
18 |
19 | # jarpath = os.path.join(os.path.abspath("."), "E:\\ks\\play_ks\\")
20 | #
21 | # jvmPath = r'E:\Java\jre1.8.0_101\bin\server\jvm.dll'
22 | #
23 | # jpype.startJVM(jvmPath, "-ea","-Djava.class.path=%s" % (jarpath + 'ks_sig.jar'))
24 | #
25 | # self.javaClass = jpype.JClass("SingatureUtil")
26 |
27 | self.t = javaClass()
28 |
29 | self.rst2 =[]
30 |
31 | self.pcursor = None
32 |
33 | self.datalist = []
34 |
35 |
36 | def get_movies(self):#随机获取20个热门视频
37 |
38 | try:
39 |
40 | url = 'http://101.251.217.216/rest/n/feed/hot?isp=CMCC&mod=lemobile%28le%20x620%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&extId=59942a6c1d534a51844dfda37e92afc3&did=ANDROID_72c3ac6bd3184a67&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560736770695&ver=6.1&max_memory=192&type=7&page=1&coldStart=false&count=20&pv=false&id=23&refreshTimes=7&pcursor=&source=1&needInterestTag=false&client_key=3c2cd3f3&os=android&sig=510e56b366931c4cb008c51ee44664c2'
41 |
42 | return Spider().get_html(url)
43 |
44 | except Exception as e :
45 |
46 | print(e.args)
47 |
48 | def get_info(self): ####获取热门20个作品数据可忽略
49 |
50 | url = 'http://140.143.173.241/rest/n/feed/hot?isp=CMCC&mod=lemobile%28le%20x620%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&extId=59942a6c1d534a51844dfda37e92afc3&did=ANDROID_72c3ac6bd3184a67&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560736770695&ver=6.1&max_memory=192&type=7&page=1&coldStart=false&count=20&pv=false&id=23&refreshTimes=7&pcursor=&source=1&needInterestTag=false&client_key=3c2cd3f3&os=android&sig=510e56b366931c4cb008c51ee44664c2'
51 |
52 | r = requests.get(url)
53 |
54 | r.encoding = r.apparent_encoding
55 |
56 | rst = r.json()['feeds']
57 |
58 | for i in rst :
59 |
60 | if 'main_mv_urls'and 'main_mv_urls_sd_h265' in i :
61 | caption = i['caption'] #标题
62 |
63 | commenet_count = i['comment_count'] #评论人数
64 |
65 | headurl = i['headurls'][1]['url'] #作品图片url连接
66 |
67 | like_count = i['like_count'] #点赞人数
68 |
69 | bourl = i['main_mv_urls_sd_h265'][1]['url'] #播放地址
70 |
71 | xiaurl = i['main_mv_urls'][1]['url'] #下载地址
72 |
73 | photo_id = i['photo_id'] #每个作品单独的作品ID
74 |
75 | if 'soundTrack' in i :
76 | soundTrack_music_url = i['soundTrack']['audioUrls'][0]['url'] #音乐链接
77 |
78 | soundTrack_img = i['soundTrack']['avatarUrls'][0]['url'] #图片链接
79 |
80 | soundTrack_id = i['soundTrack']['id']
81 |
82 | soundTrack_artist = i['soundTrack']['artist']
83 |
84 | soundTrack_name = i['soundTrack']['name']
85 |
86 | soundTrack_type = i['soundTrack']['type']
87 |
88 | try :
89 |
90 | soundTrack_user_eid =i['music']['user']['eid']
91 |
92 |
93 |
94 | except KeyError:
95 | soundTrack_user_eid = " "
96 |
97 | elif 'music' in i :
98 | soundTrack_music_url = i['music']['audioUrls'][0]['url'] #音乐链接
99 |
100 | soundTrack_img = i['music']['avatarUrls'][0]['url'] #图片链接
101 |
102 | soundTrack_id = i['music']['id']
103 |
104 | soundTrack_artist = i['music']['artist']
105 |
106 | soundTrack_name = i['music']['name']
107 |
108 | soundTrack_type = i['music']['type']
109 |
110 | try :
111 |
112 | soundTrack_user_eid =i['music']['user']['eid']
113 |
114 |
115 | except KeyError:
116 | soundTrack_user_eid = " "
117 |
118 | try :
119 | kwaiId =i['kwaiId']
120 | except KeyError:
121 | kwaiId='此账号无快手id'
122 |
123 | user_headurl = i['headurls'][0]['url'] #下载
124 |
125 | view_headurl = i['headurls'][1]['url'] #查看头部url
126 |
127 | user_id = i['user_id']
128 |
129 | user_name = i['user_name']
130 |
131 | user_sex = i['user_sex']
132 |
133 | if 'F' in user_sex:
134 |
135 | user_sex = '女'
136 |
137 | elif 'M' in user_sex :
138 |
139 | user_sex = '男'
140 |
141 | else :
142 |
143 | user_sex = ''
144 |
145 | times = i['time'] #更新时间
146 |
147 | timestamp = i['timestamp']
148 |
149 | user_type = i['type']
150 |
151 | view_count = i['view_count'] #播放人数
152 |
153 |
154 | data = {'caption':caption,'commenet_count':commenet_count,'headurl':headurl,'like_count':like_count,\
155 | 'bourl':bourl,'xiaurl':xiaurl,'photo_id':photo_id,'soundTrack_music_url':soundTrack_music_url,\
156 | 'soundTrack_img':soundTrack_img,'soundTrack_id':soundTrack_id,'soundTrack_artist':soundTrack_artist,'soundTrack_name':soundTrack_name,\
157 | 'soundTrack_type':soundTrack_type,'soundTrack_user_eid':soundTrack_user_eid,'user_headurl':user_headurl,\
158 | 'view_headurl':view_headurl,'kwaiId':kwaiId,\
159 | 'user_id':user_id,'user_name':user_name,'user_sex':user_sex,'time':times,\
160 | 'timestamp':timestamp,'user_type':user_type,'view_count':view_count
161 | }
162 |
163 | if data not in self.datalist:
164 |
165 | self.datalist.append(data)
166 | else :
167 |
168 | # with open('快手图片视频.txt') as f:
169 | # f.read(i)
170 |
171 | print('此视频为图片视频')
172 |
173 |
174 | def java(self,srcstr): #java虚拟机破解调用
175 |
176 | sig = self.t.run(srcstr)
177 |
178 | return sig
179 |
180 | def get_zuoping(self,url,vurl): #获取作品的信息
181 |
182 | sig = self.java(vurl)
183 |
184 | v_url = url+vurl+'&sig='+sig.lower()
185 |
186 | r = requests.get(v_url)
187 |
188 | r.encoding = r.apparent_encoding
189 |
190 | rst = r.json()
191 |
192 | self.rst2.append(rst['feeds'])
193 |
194 |
195 | return rst
196 |
197 | def pro(self): ###获取一组视频回显数据
198 |
199 | infos = self.get_movies()
200 |
201 | pids = [(i['photo_id'],i['user_id']) for i in infos['feeds']]
202 |
203 | ls = []
204 |
205 | for i in pids:
206 |
207 | info = self.zuoping(i[1])
208 |
209 | try:
210 |
211 | sp = [j for j in info['feeds'] if j['photo_id'] == i[0]]
212 |
213 | except KeyError:
214 |
215 | print('error')
216 |
217 | ls.append(sp)
218 |
219 | ls = [i for i in ls if len(i)!=0]
220 |
221 | ls = [i[0] for i in ls]
222 |
223 | return ls
224 |
225 |
226 | def zuoping(self,user_id): #获取第一次访问用户主页前二十作品信息
227 |
228 |
229 |
230 | # user_id = 30003873
231 |
232 | url = 'http://api.ksapisrv.com/rest/n/feed/profile2?'
233 |
234 | url = 'http://140.143.173.241/rest/n/feed/profile2?'
235 |
236 | vurl = 'isp=CMCC&mod=vivo%28vivo%20x5m%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_d1f47e9473209293&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560817030537&ver=6.1&retryTimes=1&max_memory=192&token=&user_id={}&lang=zh&count=30&privacy=public&referer=ks%3A%2F%2Fprofile%2F1253495500%2F5254856356897643841%2F1_a%2F1636737039616946179_h86%2F8&client_key=3c2cd3f3&os=android'.format(user_id)
237 |
238 | rst2 = self.get_zuoping(url,vurl)
239 |
240 | self.pcursor=rst2['pcursor']
241 |
242 | print(rst2['pcursor'])
243 |
244 | return rst2
245 | #
246 |
247 | def dowork(self,user_id,pcursor): ##工作函数负责获取加密的pcursor值在获取个人所有作品中调用
248 | url = 'http://140.143.173.241/rest/n/feed/profile2?'
249 |
250 | vurl = 'isp=CMCC&mod=lemobile%28le%20x620%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_72c3ac6bd3184a67&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560736770695&ver=6.1&max_memory=192&token=&user_id={}&lang=zh&count=30&privacy=public&pcursor={}&referer=ks%3A%2F%2Fprofile%2F118261131%2F5211227733411179550%2F1_i%2F1636757237963010050_h86%2F8&client_key=3c2cd3f3&os=android'.format(user_id,pcursor)
251 |
252 | try:
253 | rst =self.get_zuoping(url,vurl)
254 |
255 | self.pcursor = rst['pcursor']
256 |
257 | print(rst['pcursor'])
258 | except Exception as e:
259 |
260 | print(e.args)
261 | def zuopinghou(self,user_id): ##获取个人所有作品
262 |
263 | while True :
264 | self.dowork(user_id,self.pcursor)
265 |
266 | if self.pcursor == 'no_more' :
267 | break
268 |
269 | if __name__ == '__main__' :
270 |
271 | x = kuaishou()
272 |
273 | start=time.time()
274 |
275 | info = x.pro()
276 |
277 | print('耗时:',time.time()-start) ##获取热门二十条视频 一直请求一直叠加
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
--------------------------------------------------------------------------------
/play_ks/rjh.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | """
3 | Created on Wed Jun 19 19:55:16 2019
4 |
5 | @author: dell
6 | """
7 |
8 | import requests
9 | import os
10 | import jpype
11 |
12 | class KuaiShou:
13 |
14 | def __init__(self,javaClass): #初始化Java虚拟机参数
15 |
16 | # jarpath=os.path.join(os.path.abspath('.'),"D:\\program\\workspace2\\testSolr\\commons-lang3-3.8.jar")
17 | #
18 | # jarpath2=os.path.join(os.path.abspath('.'),"D:\\program\\workspace2\\testSolr\\jiemi2.jar")
19 | #
20 | # # 使用jpype开启虚拟机(在开启jvm之前要加载类路径)
21 | # jpype.startJVM("D:\\program\\java\\jdk1.8.0_101\\jre\\bin\\server\\jvm.dll","-ea","-Djava.class.path=%s;%s"%(jarpath,jarpath2))
22 | # # 加载java类(参数是java的长类名)
23 | # jpype.JClass("org.apache.commons.lang3.StringUtils")
24 |
25 | # self.javaClass = jpype.JClass("test.SingatureUtil")
26 |
27 | # sign=javaClass.genSignature(javaClass.getMapFromStr(urlParams),javaClass.FANS_SALT)
28 |
29 | self.t=javaClass()
30 |
31 | self.ls={}
32 |
33 | self.ls2={}
34 |
35 | self.rst2=[]
36 |
37 | self.pcursor=None
38 |
39 | def java(self,srcStr): #java虚拟机破解调用
40 |
41 | sig=self.t.run(srcStr)
42 |
43 | # sig=self.javaClass.genSignature(self.javaClass.getMapFromStr(srcStr),self.javaClass.FANS_SALT)
44 |
45 | # print(sig.lower())
46 |
47 | return sig
48 |
49 | def getResponse(self,url): #联网获取数据,返回json
50 |
51 | resp=requests.get(url)
52 |
53 | resp.encoding=resp.apparent_encoding
54 |
55 | jso=resp.json()
56 |
57 | return jso
58 |
59 | # @property
60 | # def get_hot_production(self):
61 | #
62 | # url='http://103.107.217.65/rest/n/feed/hot?isp=CMCC&mod=samsung%28sm-g530h%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&extId=8285bb939fb45c67c865b8afb6419baf&did=ANDROID_e928f0db23263e87&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560816984874&ver=6.1&max_memory=192&type=7&page=1&coldStart=false&count=20&pv=false&id=107&refreshTimes=4&pcursor=&source=1&needInterestTag=false&client_key=3c2cd3f3&os=android&sig=ac2716c6c7345d3bdcc8a1c8b5cdcd99'
63 | #
64 | # jso=self.getResponse(url)
65 | #
66 | # params=jso['feeds']
67 | #
68 | # for i in params:
69 | #
70 | # caption=i['caption'] #标题
71 | #
72 | # comment_count=i['comment_count'] #评论次数
73 | #
74 | # down_headUrls=i['headurls'][0]['url'] #封面图片下载地址
75 | #
76 | # play_headUrls=i['headurls'][1]['url'] #封面播放地址
77 | #
78 | # like_count=i['like_count'] #点赞
79 | #
80 | # if 'main_mv_urls' in i.keys():
81 | #
82 | # down_main_mv_urls=i['main_mv_urls'][0]['url'] #视频下载地址
83 | #
84 | # play_main_mv_urls=i['main_mv_urls'][1]['url'] #视频播放地址 手机app两个网址都可以播放
85 | #
86 | # else:
87 | #
88 | # down_main_mv_urls=''
89 | #
90 | # play_main_mv_urls=''
91 | #
92 | # photo_id=i['photo_id']
93 | #
94 | # if 'soundTrack' in i.keys():
95 | #
96 | # soundTrack_music_url=i['soundTrack']['audioUrls'][0]['url'] #y音乐链接
97 | #
98 | # soundTrack_user_avatarUrls=i['soundTrack']['avatarUrls'][0]['url'] #背景音乐歌手图片地址
99 | #
100 | # soundTrack_id=i['soundTrack']['id'] #音乐id
101 | #
102 | # soundTrack_artist=i['soundTrack']['artist'] #背景音乐歌手
103 | #
104 | # soundTrack_name=i['soundTrack']['name'] #音乐名字
105 | #
106 | # soundTrack_type=i['soundTrack']['type'] #音乐类型
107 | #
108 | # try:
109 | #
110 | # soundTrack_user_eid=i['soundTrack']['user']['eid']
111 | #
112 | # except KeyError:
113 | #
114 | # soundTrack_user_eid=''
115 | #
116 | # try :
117 | #
118 | # kwaiId =i['kwaiId']
119 | #
120 | # except KeyError:
121 | #
122 | # kwaiId='此账号无快手id'
123 | #
124 | # elif 'music' in i.keys():
125 | #
126 | # soundTrack_music_url=i['music']['audioUrls'][0]['url'] #y音乐链接
127 | #
128 | # soundTrack_user_avatarUrls=i['music']['avatarUrls'][0]['url'] #头像播放地址
129 | #
130 | # soundTrack_id=i['music']['id'] #音乐id
131 | #
132 | # soundTrack_artist=i['music']['artist'] #艺人
133 | #
134 | # soundTrack_name=i['music']['name'] #音乐名字
135 | #
136 | # soundTrack_type=i['music']['type'] #音乐类型
137 | #
138 | # try:
139 | #
140 | # soundTrack_user_eid=i['music']['user']['eid']
141 | #
142 | # except KeyError:
143 | #
144 | # soundTrack_user_eid=''
145 | #
146 | # user_name=i['user_name']
147 | #
148 | # user_sex=i['user_sex']
149 | #
150 | # user_id=i['user_id']
151 | #
152 | # if user_sex=='F':
153 | #
154 | # user_sex='女'
155 | #
156 | # elif user_sex=='M':
157 | #
158 | # user_sex='男'
159 | #
160 | # else:
161 | #
162 | # user_sex=''
163 | #
164 | # time=i['time'] #更新时间
165 | #
166 | # timestamp=i['timestamp'] #时间戳
167 | #
168 | # view_count=i['view_count'] #浏览次数
169 | #
170 | #
171 | # videoinfo={
172 | # 'caption':caption,'comment_count':comment_count,\
173 | # 'down_headUrls':down_headUrls,'play_headUrls':play_headUrls,\
174 | # 'like_count':like_count,'down_main_mv_urls':down_main_mv_urls,\
175 | # 'play_main_mv_urls':play_main_mv_urls,'photo_id':photo_id,'soundTrack_music_urls':soundTrack_music_url,\
176 | # 'soundTrack_user_avatarUrls':soundTrack_user_avatarUrls,'soundTrack_id':soundTrack_id,\
177 | # 'soundTrack_artist':soundTrack_artist,'soundTrack_name':soundTrack_name,'soundTrack_type':soundTrack_type,\
178 | # 'soundTrack_user_eid':soundTrack_user_eid,'user_id':user_id,'user_name':user_name,'user_sex':user_sex,'time':time,'timestamp':timestamp,'view_count':view_count
179 | # }
180 | #
181 | #
182 | # self.ls2[play_main_mv_urls]=videoinfo
183 | #
184 | # return self.ls2
185 |
186 |
187 | def get_productionTop_url(self,url,vurl):
188 |
189 | sig=self.java(vurl)
190 |
191 | print(sig.lower())
192 |
193 | v_url=url+vurl+'&sig='+sig.lower() #获取到拼接的url
194 |
195 | print('拼接的url:'+v_url)
196 |
197 | jso=self.getResponse(v_url)
198 |
199 | return jso
200 |
201 | # def get_productionBelow_url(self,url,vurl):
202 | #
203 | # sig=self.java(vurl)
204 | #
205 | # v_url=url+vurl+'&sig='+sig.lower() #获取到拼接的url
206 | #
207 | # jso=self.getResponse(v_url)
208 | #
209 | # print(jso)
210 | #
211 | # self.rst2.append(jso['feeds'])
212 | #
213 | # return jso
214 |
215 | def parseUser1(self,user_id): #获取用户主页信息(不包含主页发布的视频)
216 |
217 | # url='http://103.107.217.165/rest/n/user/profile/v2?isp=CMCC&mod=samsung%28sm-g530h%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_e928f0db23263e87&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560816984874&ver=6.1&retryTimes=1&max_memory=192&user=1212501318&client_key=3c2cd3f3&os=android&sig=a2247d9c8a44b47fbc45b5aaae92826b'
218 |
219 | url='http://103.107.217.165/rest/n/user/profile/v2?'
220 |
221 | vurl='isp=CMCC&mod=samsung%28sm-g530h%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_e928f0db23263e87&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560816984874&ver=6.1&retryTimes=1&max_memory=192&user={}&client_key=3c2cd3f3&os=android'.format(user_id)
222 |
223 | jso=self.get_productionTop_url(url,vurl)
224 |
225 | up=jso['userProfile']
226 |
227 | user_name=up['profile']['user_name']
228 |
229 | if 'cityName' in jso['userProfile'].keys():
230 |
231 | user_cityName=up['cityName'] #城市名称
232 |
233 | else:
234 |
235 | user_cityName='此用户未填写城市名称'
236 |
237 | if 'user_profile_bg_urls' in up['profile'].keys():
238 |
239 | if len(up['profile']['user_profile_bg_urls']) > 1:
240 |
241 | user_backgroundImage=up['profile']['user_profile_bg_urls'][1]['url'] #用户主页背景图片
242 |
243 | else:
244 |
245 | user_backgroundImage=up['profile']['user_profile_bg_urls'][0]['url']
246 |
247 | else:
248 |
249 | user_backgroundImage=''
250 |
251 | if 'headurls' in up['profile'].keys():
252 |
253 | user_headUrl=up['profile']['headurls'][1]['url']#用户头像
254 |
255 | else:
256 |
257 | user_headUrl=''
258 |
259 |
260 | user_fans=up['ownerCount']['fan'] #粉丝量
261 |
262 | user_follow=up['ownerCount']['follow'] #关注人数
263 |
264 | user_sex=up['profile']['user_sex'] #用户性别
265 |
266 | if user_sex=='F':
267 |
268 | user_sex='女'
269 |
270 | elif user_sex=='M':
271 |
272 | user_sex='男'
273 |
274 | else:
275 |
276 | user_sex=''
277 |
278 | user_text=up['profile']['user_text'] #用户简介
279 |
280 | user_photo=up['ownerCount']['photo'] #发布视频个数
281 |
282 | userInfo={
283 | 'user_name':user_name,'user_sex':user_sex,'user_headUrl':user_headUrl,'user_backgroundimage':user_backgroundImage,'user_fans':user_fans,'user_follow':user_follow,'user_photo':user_photo,
284 | 'user_text':user_text,'user_cityName':user_cityName,
285 | }
286 |
287 | self.ls[user_name]=userInfo
288 |
289 | return self.ls
290 |
291 | # def parseUser2(self,user_id):
292 | #
293 | # url='http://103.107.217.2/rest/n/feed/profile2?'
294 | #
295 | # vurl='isp=CMCC&mod=samsung%28sm-g530h%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_e928f0db23263e87&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560816984874&ver=6.1&max_memory=192&token=&user_id={}&lang=zh&count=30&privacy=public&referer=ks%3A%2F%2Fprofile%2F59719804%2F5194339237167842050%2F1_i%2F1636817716625289218_h86%2F8&client_key=3c2cd3f3&os=android'.format(user_id)
296 | #
297 | # jso=self.get_productionBelow_url(url,vurl)
298 | #
299 | # self.pcursor=jso['pcursor']
300 | #
301 | # print(jso['pcursor'])
302 | #
303 | # return jso
304 | #
305 | # def work(self,user_id,pcursor):
306 | #
307 | # url='http://103.107.217.65/rest/n/feed/profile2?'
308 | #
309 | # vurl='isp=CMCC&mod=samsung%28sm-g530h%29&lon=116.41025&country_code=cn&kpf=ANDROID_PHONE&did=ANDROID_e928f0db23263e87&kpn=KUAISHOU&net=WIFI&app=0&oc=MYAPP%2C1&ud=0&hotfix_ver=&c=MYAPP%2C1&sys=ANDROID_5.1.1&appver=6.1.0.8039&ftt=&language=zh-cn&iuid=&lat=39.916411&did_gt=1560816984874&ver=6.1&max_memory=192&token=&user_id={}&lang=zh&count=30&privacy=public&pcursor={}&referer=ks%3A%2F%2Fprofile%2F1212501318%2F5207568557927131014%2F1_i%2F1636761941840220164_h86%2F8&client_key=3c2cd3f3&os=android'.format(user_id,pcursor)
310 | #
311 | # try:
312 | #
313 | # jso=self.get_productionBelow_url(url,vurl)
314 | #
315 | # pcursor=jso['pcursor']
316 | #
317 | # print(jso['pcursor'])
318 | #
319 | # except Exception as e:
320 | #
321 | # print(e.args)
322 | #
323 | # def belowProduction(self,user_id):
324 | #
325 | # while True:
326 | #
327 | # self.work(user_id,self.pcursor)
328 | #
329 | # if self.pcursor=='no_more':
330 | #
331 | # break
332 |
333 | if __name__=='__main__':
334 |
335 | kuaishou=KuaiShou()
336 |
337 | # ls2=kuaishou.get_hot_production
338 |
339 | ls=kuaishou.parseUser1(1061241178) #传入一个用户id可以查看用户相关信息(不包含个人发布视频)
340 |
341 | # one=kuaishou.parseUser2(1348593527)
342 | #
343 | # from multiprocessing.dummy import Pool
344 | #
345 | # p=Pool(5)
346 | #
347 | # two=p.map(kuaishou.belowProduction,[1348593527])
348 |
349 |
350 | # two=kuaishou.belowProduction(1348593527)
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 |
--------------------------------------------------------------------------------
/myks/static/myks/fonts/iconfont.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
81 |
--------------------------------------------------------------------------------
/myks/static/myks/fonts/iconfont.js:
--------------------------------------------------------------------------------
1 | !function(s){var a,o='',t=(a=document.getElementsByTagName("script"))[a.length-1].getAttribute("data-injectcss");if(t&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}!function(a){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(a,0);else{var t=function(){document.removeEventListener("DOMContentLoaded",t,!1),a()};document.addEventListener("DOMContentLoaded",t,!1)}else document.attachEvent&&(o=a,c=s.document,e=!1,i=function(){e||(e=!0,o())},(n=function(){try{c.documentElement.doScroll("left")}catch(a){return void setTimeout(n,50)}i()})(),c.onreadystatechange=function(){"complete"==c.readyState&&(c.onreadystatechange=null,i())});var o,c,e,i,n}(function(){var a,t;(a=document.createElement("div")).innerHTML=o,o=null,(t=a.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",function(a,t){t.firstChild?function(a,t){t.parentNode.insertBefore(a,t)}(a,t.firstChild):t.appendChild(a)}(t,document.body))})}(window);
--------------------------------------------------------------------------------
/myks/static/myks/fonts/demo_index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IconFont Demo
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | - Unicode
22 | - Font class
23 | - Symbol
24 |
25 |
26 |
查看项目
27 |
28 |
29 |
30 |
31 |
32 |
33 | -
34 |
35 |
分享
36 | 
37 |
38 |
39 | -
40 |
41 |
返回
42 | 
43 |
44 |
45 | -
46 |
47 |
关闭
48 | 
49 |
50 |
51 | -
52 |
53 |
播放
54 | 
55 |
56 |
57 | -
58 |
59 |
客服
60 | 
61 |
62 |
63 | -
64 |
65 |
身份证
66 | 
67 |
68 |
69 | -
70 |
71 |
全屏
72 | 
73 |
74 |
75 | -
76 |
77 |
暂停
78 | 
79 |
80 |
81 | -
82 |
83 |
收藏
84 | 
85 |
86 |
87 | -
88 |
89 |
箭头 上
90 | 
91 |
92 |
93 | -
94 |
95 |
箭头 上
96 | 
97 |
98 |
99 | -
100 |
101 |
箭头 右
102 | 
103 |
104 |
105 | -
106 |
107 |
箭头 下
108 | 
109 |
110 |
111 | -
112 |
113 |
我的
114 | 
115 |
116 |
117 | -
118 |
119 |
首页
120 | 
121 |
122 |
123 | -
124 |
125 |
分类
126 | 
127 |
128 |
129 | -
130 |
131 |
搜索
132 | 
133 |
134 |
135 | -
136 |
137 |
换一换
138 | 
139 |
140 |
141 |
142 |
143 |
Unicode 引用
144 |
145 |
146 |
Unicode 是字体在网页端最原始的应用方式,特点是:
147 |
148 | - 兼容性最好,支持 IE6+,及所有现代浏览器。
149 | - 支持按字体的方式去动态调整图标大小,颜色等等。
150 | - 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。
151 |
152 |
153 | 注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式
154 |
155 |
Unicode 使用步骤如下:
156 |
第一步:拷贝项目下面生成的 @font-face
157 |
@font-face {
159 | font-family: 'iconfont';
160 | src: url('iconfont.eot');
161 | src: url('iconfont.eot?#iefix') format('embedded-opentype'),
162 | url('iconfont.woff2') format('woff2'),
163 | url('iconfont.woff') format('woff'),
164 | url('iconfont.ttf') format('truetype'),
165 | url('iconfont.svg#iconfont') format('svg');
166 | }
167 |
168 |
第二步:定义使用 iconfont 的样式
169 |
.iconfont {
171 | font-family: "iconfont" !important;
172 | font-size: 16px;
173 | font-style: normal;
174 | -webkit-font-smoothing: antialiased;
175 | -moz-osx-font-smoothing: grayscale;
176 | }
177 |
178 |
第三步:挑选相应图标并获取字体编码,应用于页面
179 |
180 | <span class="iconfont">3</span>
182 |
183 |
184 | "iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。
185 |
186 |
187 |
188 |
189 |
354 |
355 |
font-class 引用
356 |
357 |
358 |
font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。
359 |
与 Unicode 使用方式相比,具有如下特点:
360 |
361 | - 兼容性良好,支持 IE8+,及所有现代浏览器。
362 | - 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
363 | - 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
364 | - 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
365 |
366 |
使用步骤如下:
367 |
第一步:引入项目下面生成的 fontclass 代码:
368 |
<link rel="stylesheet" href="./iconfont.css">
369 |
370 |
第二步:挑选相应图标并获取类名,应用于页面:
371 |
<span class="iconfont icon-xxx"></span>
372 |
373 |
374 | "
375 | iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。
376 |
377 |
378 |
379 |
380 |
381 |
382 | -
383 |
386 |
分享
387 | #icon-fenxiang
388 |
389 |
390 | -
391 |
394 |
返回
395 | #icon-fanhui
396 |
397 |
398 | -
399 |
402 |
关闭
403 | #icon-guanbi
404 |
405 |
406 | -
407 |
410 |
播放
411 | #icon-bofang
412 |
413 |
414 | -
415 |
418 |
客服
419 | #icon-kefu
420 |
421 |
422 | -
423 |
426 |
身份证
427 | #icon-shenfenzheng
428 |
429 |
430 | -
431 |
434 |
全屏
435 | #icon-quanping
436 |
437 |
438 | -
439 |
442 |
暂停
443 | #icon-zanting
444 |
445 |
446 | -
447 |
450 |
收藏
451 | #icon-shoucang
452 |
453 |
454 | -
455 |
458 |
箭头 上
459 | #icon-jiantoushang
460 |
461 |
462 | -
463 |
466 |
箭头 上
467 | #icon-jiantoushang1
468 |
469 |
470 | -
471 |
474 |
箭头 右
475 | #icon-jiantouyou
476 |
477 |
478 | -
479 |
482 |
箭头 下
483 | #icon-jiantouxia
484 |
485 |
486 | -
487 |
490 |
我的
491 | #icon-wode
492 |
493 |
494 | -
495 |
498 |
首页
499 | #icon-shouye
500 |
501 |
502 | -
503 |
506 |
分类
507 | #icon-fenlei
508 |
509 |
510 | -
511 |
514 |
搜索
515 | #icon-sousuo
516 |
517 |
518 | -
519 |
522 |
换一换
523 | #icon-huanyihuan
524 |
525 |
526 |
527 |
528 |
Symbol 引用
529 |
530 |
531 |
这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章
532 | 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:
533 |
534 | - 支持多色图标了,不再受单色限制。
535 | - 通过一些技巧,支持像字体那样,通过
font-size, color 来调整样式。
536 | - 兼容性较差,支持 IE9+,及现代浏览器。
537 | - 浏览器渲染 SVG 的性能一般,还不如 png。
538 |
539 |
使用步骤如下:
540 |
第一步:引入项目下面生成的 symbol 代码:
541 |
<script src="./iconfont.js"></script>
542 |
543 |
第二步:加入通用 CSS 代码(引入一次就行):
544 |
<style>
545 | .icon {
546 | width: 1em;
547 | height: 1em;
548 | vertical-align: -0.15em;
549 | fill: currentColor;
550 | overflow: hidden;
551 | }
552 | </style>
553 |
554 |
第三步:挑选相应图标并获取类名,应用于页面:
555 |
<svg class="icon" aria-hidden="true">
556 | <use xlink:href="#icon-xxx"></use>
557 | </svg>
558 |
559 |
560 |
561 |
562 |
563 |
564 |
583 |
584 |
585 |
--------------------------------------------------------------------------------