Skip to content

Instantly share code, notes, and snippets.

@0187773933
Created March 21, 2024 14:58
Show Gist options
  • Save 0187773933/8ef5233961820b5cec0a45566669381f to your computer and use it in GitHub Desktop.
Save 0187773933/8ef5233961820b5cec0a45566669381f to your computer and use it in GitHub Desktop.
Exports Netflix Series IDs to yaml
( ()=> {
let episodes = document.querySelectorAll( "div.titleCardList--metadataWrapper" );
let yaml_string = "";
for ( let i = 0; i < episodes.length; ++i ) {
let title_text = episodes[ i ].querySelector( "span.titleCard-title_text" ).innerText;
let info_elem = episodes[ i ].querySelector( "div.ptrack-content" );
// let extra_text = info_elem.innerText;
let meta_data_ue = info_elem.getAttribute( "data-ui-tracking-context" );
let meta_data_str = decodeURIComponent( meta_data_ue );
let meta_data = JSON.parse( meta_data_str );
let video_id = meta_data[ "video_id" ];
let track_id = meta_data[ "track_id" ];
let id = `${video_id}?trackId=${track_id}`;
console.log( i , title_text , video_id , track_id );
yaml_string += ` - id: ${id}\n`;
yaml_string += ` name: "${title_text}"\n`;
}
console.log( yaml_string );
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment