- Open Chrome Developer tools and click the Network tab.
- Navigate to the page with the video and get it to start playing.
- Filter the list of files to "m3u8".
- Find master.m3u8 or index.m3u8 and click on it.
- Save the file to disk and look inside it.
- If the file contains a single m3u8 master url, copy that one instead.
- Run the program m3u8x.
- Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SEARCH_INPUT_SELECTOR = 'div[role="search"] input[role="searchbox"]'; | |
const ADD_BUTTON_SELECTOR = 'div[role="presentation"] > div[role="row"] button[aria-label="Add to Playlist"]'; | |
const input = document.querySelector(SEARCH_INPUT_SELECTOR); | |
const tracks = ['test']; | |
const wait = async (timeout) => new Promise((resolve) => setTimeout(resolve, timeout)); | |
const findTracks = async (track) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TRACKS_SELECTOR = 'div.d-track__overflowable-column > div.d-track__overflowable-wrapper.deco-typo-secondary.block-layout'; | |
const TRACK_NAME_SELECTOR = '.d-track__title'; | |
const TRACK_VERSION_SELECTOR = '.d-track__version'; | |
const TRACK_ARTISTS_SELECTOR = '.d-track__artists > a'; | |
const trackElements = document.querySelectorAll(TRACKS_SELECTOR); | |
const tracks = []; | |
trackElements.forEach((trackElement) => { | |
const name = trackElement.querySelector(TRACK_NAME_SELECTOR).innerHTML.trim(); | |
const version = trackElement.querySelector(TRACK_VERSION_SELECTOR)?.innerHTML.trim(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple gist to test parallel promise resolution when using async / await | |
function promiseWait(time) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve(true); | |
}, time); | |
}); | |
} |
React Component Lifecycle
- getInitialState
- getDefaultProps
- componentWillMount
- componentDidMount
- shouldComponentUpdate (Update only)
- componentWillUpdate (Update only)
- componentWillReceiveProps (Update only)
- render
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loaderUtils = require('loader-utils'); | |
module.exports = function(source) { | |
this.cacheable && this.cacheable(); | |
var query = loaderUtils.parseQuery(this.query); | |
var args = []; | |
// apply?config=key => sourceFn(require('webpack.config').key) | |
if (typeof query.config === 'string') { | |
if (!query.config in this.options) |
This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded
that can be called on DOM elements.
Just use the code in index.js
in your app or website. You can see usage in the test page test.html
.
The parent element will only scroll if the element being called is out of the view. The boolean can force the element to be centered in the scrolling area.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['найдена', 'найдено', 'найдены']); |