Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'streamkiste.tv': {
- regex: /https?:\/\/(?:www\.)?streamkiste\.tv\/(?:movie\/[\w-]+(\d{4})-(\d+)|(#captcha$))/,
- groups: ['year', 'id', 'captcha'],
- getInfo() {
- return this.bot.fetch(this.url, {
- match: /<title>([^<]*) HD Stream » StreamKiste\.tv<\/title>[\s\S]+pid:"(\d+)/,
- $: true
- }).then(({ match, $ }) => {
- this.title = match[1]
- const pid = match[2]
- const rlss = $('#rel > option').map((i, e) => {
- console.log(e.attribs)
- return e.attribs
- }).toArray().filter(({ selected }) => selected != undefined)
- const mirrors = $('[href=\'#video\']').map((i, e) => {
- return e.attribs
- }).toArray().reduce((acc, attribs) => {
- let { 'data-mirror': mirror, 'data-host': host, title } = attribs
- title = (title.match(/'([^']+)/) || [])[1]
- if (!/^nxload/i.test(title)) return acc
- if (!acc[title]) acc[title] = []
- acc[title].push({ host, mirror})
- return acc
- }, {})
- console.log(pid)
- console.log(rlss)
- console.log(mirrors)
- return this.bot.fetch(this.url, {
- method: 'POST',
- form: {
- req: '3',
- pid,
- ...Object.values(mirrors).pop().pop(),
- rel: rlss.pop().data,
- token: this.bot.API.add.captchas.pop()
- },
- customerr: [302]
- })
- }).then(({ res, body, statusCode }) => {
- let url
- if (statusCode === 302) url = res.headers.location
- else url = body
- console.log(url)
- this.matchUrl(url, this.bot.API.add.providerlist)
- return this.getInfo().then(addition => {
- addition.title = title
- if (addition.type === 'cm' && !addition.duration)
- return this.bot.API.add.getDuration(addition)
- return addition
- })
- })
- },
- userScript: function() {
- if (!this.match[3]) return
- const setup = () => {
- grecaptcha.render({
- sitekey: '6LcGFzMUAAAAAJaE5lmKtD_Oi_YzC837_Nwt6Btv',
- size: 'invisible',
- callback: captcha => {
- console.log(captcha)
- GM.xmlHttpRequest({
- method: 'GET',
- url: `${config.weblink}/recaptcha/${captcha}`,
- onload: res => {
- console.log(res.responseText)
- grecaptcha.reset()
- setup()
- },
- onerror: console.error
- })
- }
- })
- grecaptcha.execute()
- }
- unsafeWindow.setup = setup
- const script = document.createElement('script')
- script.setAttribute('type', 'text/javascript')
- script.setAttribute('src', 'https://www.google.com/recaptcha/api.js?onload=setup&render=explicit')
- document.getElementsByTagName('head').item(0).appendChild(script)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement