Skip to content

Commit afef338

Browse files
committed
[netflix subs] fix title getting function
1 parent 421ad36 commit afef338

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Netflix_-_subtitle_downloader.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name Netflix - subtitle downloader
33
// @description Allows you to download subtitles from Netflix
44
// @license MIT
5-
// @version 2.2.0
5+
// @version 2.2.1
66
// @namespace tithen-firion.github.io
77
// @include https://www.netflix.com/*
88
// @grant none
@@ -232,12 +232,12 @@ function getTitle(full) {
232232
var titleElement = document.querySelector(MAIN_TITLE);
233233
if(titleElement === null)
234234
return null;
235-
var title = titleElement.innerText.replace(/[:*?"<>|\\\/]+/g, '_').replace(/ /g, '.');
235+
var title = titleElement.textContent.replace(/[:*?"<>|\\\/]+/g, '_').replace(/ /g, '.');
236236
if(full) {
237237
title += '.';
238238
var episodeElement = titleElement.nextElementSibling;
239239
if(episodeElement) {
240-
var m = episodeElement.innerText.match(/^[^\d]*?(\d+)[^\d]*?(\d+)?[^\d]*?$/);
240+
var m = episodeElement.textContent.match(/^[^\d]*?(\d+)[^\d]*?(\d+)?[^\d]*?$/);
241241
if(m && m.length == 3) {
242242
if(typeof m[2] == 'undefined') // example: Stranger Things season 1
243243
title += 'S01E' + m[1].padStart(2, '0') + '.';

0 commit comments

Comments
 (0)