-
- {{(props.data.time/props.data.duration*100).toFixed(0)}}%
-
@@ -81,10 +82,15 @@
{{props.data.name}}
- {{props.data.detail.area}}
- {{props.data.detail.year}}
- {{props.data.detail.note}}
- {{props.data.detail.type}}
+
+ 进度:
+
+
+ 第{{ props.data.index + 1 }}集(共{{props.data.detail.m3u8List.length}}集)
+
+
+ {{fmtMSS(props.data.time.toFixed(0))}}/{{fmtMSS(props.data.duration.toFixed(0))}}
+
@@ -157,6 +163,9 @@ export default {
},
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
+ fmtMSS (s) {
+ return (s - (s %= 60)) / 60 + (s > 9 ? ':' : ':0') + s
+ },
detailEvent (e) {
this.detail = {
show: true,
diff --git a/src/lib/site/tools.js b/src/lib/site/tools.js
index effdceb..bc03379 100644
--- a/src/lib/site/tools.js
+++ b/src/lib/site/tools.js
@@ -217,6 +217,20 @@ const zy = {
const data = res.data
const json = parser.parse(data, this.xmlConfig)
const videoList = json.rss.list.video
+ // Parse m3u8List
+ var m3u8List = []
+ const dd = videoList.dl.dd
+ const type = Object.prototype.toString.call(dd)
+ if (type === '[object Array]') {
+ for (const i of dd) {
+ if (i._flag.indexOf('m3u8') >= 0) {
+ m3u8List = i._t.split('#')
+ }
+ }
+ } else {
+ m3u8List = dd._t.split('#')
+ }
+ videoList.m3u8List = m3u8List
resolve(videoList)
}).catch(err => {
reject(err)