Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
54ac committed Jul 16, 2020
1 parent 4932b77 commit f99ec93
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 99 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ More details and screenshots available [in the AMO listing](https://addons.mozil
Being able to easily find direct URLs to streams on the Internet. I wrote this initially for my own use - I was fed up with hunting for URLs in the Network Monitor and manually adding all the necessary headers and cookies.

### Is anyone even using this?
As of writing this document, the addon has been downloaded over 210,000 times, with over 6,500 average daily users. [The usage statistics are publicly available](https://addons.mozilla.org/en-US/firefox/addon/hls-stream-detector/statistics/), in case anyone is interested.
As of writing this document, the addon has been downloaded over 215,000 times, with over 6,500 average daily users. [The usage statistics are publicly available](https://addons.mozilla.org/en-US/firefox/addon/hls-stream-detector/statistics/), in case anyone is interested.

### How do I use this?
Upon being notified that a stream has been detected (as in the screenshot above), click the toolbar button, and then click on the appropriate filename to copy the URL in its desired form. Use the addon's options page to customize your experience.
Expand All @@ -40,4 +40,5 @@ Upon being notified that a stream has been detected (as in the screenshot above)


### Additional notes
This should go without saying, but I am not responsible for and do not condone this addon being used for any nefarious purposes. Copyrighted content is probably DRM-ed anyway.
- Websites such as YouTube, Vimeo, Facebook, etc. are very likely to use proprietary technologies which are not supported by this addon. When it comes to such "mainstream" services, it's better to use the tools (e.g. youtube-dl) directly.
- This should go without saying, but I am not responsible for and do not condone this addon being used for any nefarious purposes. Copyrighted content is probably DRM-ed anyway.
13 changes: 8 additions & 5 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"message": "Stream detected!"
},
"notifText": {
"message": "Note: All addon functionality has been moved to the toolbar button.\n\nNew stream detected:\n"
"message": "New stream detected:\n"
},
"notifCopiedTitle": {
"message": "URL(s) copied!"
Expand All @@ -12,7 +12,7 @@
"message": "Successfully copied the following URL(s):\n"
},
"notifIncompCopiedText": {
"message": "Use of youtube-dl is recommended.\nStream URL(s) copied in plain form due to lack of compatibility with the chosen tool:\n"
"message": "Use of youtube-dl is recommended.\n\nStream URL(s) copied in plain form due to lack of compatibility with the chosen tool:\n"
},
"notifErrorTitle": {
"message": "Copy error!"
Expand Down Expand Up @@ -42,7 +42,7 @@
"message": "hlsdl command"
},
"user": {
"message": "User defined command"
"message": "User-defined command"
},
"streamlinkOutput": {
"message": "Output Streamlink to:"
Expand All @@ -57,7 +57,10 @@
"message": "Additional command line parameters:"
},
"userCommand": {
"message": "User defined command line - available fields: "
"message": "User-defined command:"
},
"userCommandTip": {
"message": "Available fields:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%"
},
"headersPref": {
"message": "Include additional headers:"
Expand Down Expand Up @@ -113,4 +116,4 @@
"filterInput": {
"message": "Filter:"
}
}
}
13 changes: 11 additions & 2 deletions _locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"message": "Wykryto stream!"
},
"notifText": {
"message": "Uwaga: Funkcjonalność rozszerzenia została przeniesiona do przycisku na pasku narzędzi.\n\nWykryto nowy stream:\n"
"message": "Wykryto nowy stream:\n"
},
"notifCopiedTitle": {
"message": "Skopiowano link(i)!"
Expand All @@ -12,7 +12,7 @@
"message": "Pomyślnie skopiowano następujące link(i) do schowka:\n"
},
"notifIncompCopiedText": {
"message": "Zalecane jest użycie youtube-dl.\nDane skopiowane w zwykłej formie z powodu użycia narzędzia niekompatybilnego z rodzajem streamu:\n"
"message": "Zalecane jest użycie youtube-dl.\n\nDane skopiowane w zwykłej formie z powodu użycia narzędzia niekompatybilnego z rodzajem streamu:\n"
},
"notifErrorTitle": {
"message": "Błąd kopiowania!"
Expand Down Expand Up @@ -41,6 +41,9 @@
"hlsdl": {
"message": "Komendę hlsdl"
},
"user": {
"message": "Komendę własną"
},
"streamlinkOutput": {
"message": "Przesyłaj strumień wyjściowy Streamlink do:"
},
Expand All @@ -53,6 +56,12 @@
"customCommand": {
"message": "Dodatkowe argumenty linii poleceń:"
},
"userCommand": {
"message": "Komenda własna:"
},
"userCommandTip": {
"message": "Dostępne pola:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%"
},
"headersPref": {
"message": "Dołącz dodatkowe nagłówki:"
},
Expand Down
6 changes: 4 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

const listenerFilter = {
urls: [
"*://*/*.m3u8",
Expand All @@ -16,7 +18,7 @@ const listenerFilter = {

const _ = browser.i18n.getMessage;

var urlStorage = [];
let urlStorage = [];
function setup() {
//clear everything and/or set up
browser.browserAction.setBadgeText({ text: "" });
Expand Down Expand Up @@ -49,7 +51,7 @@ function setup() {
});
}

var badgeText = 0;
let badgeText = 0;
function addURL(requestDetails) {
const checkUrl = urlStorage.filter(e => e.url === requestDetails.url);

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"manifest_version": 2,
"name": "The Stream Detector",
"default_locale": "en",
"version": "2.1.2",
"version": "2.2.0",
"permissions": [
"webRequest",
"*://*/*.m3u8",
Expand Down
14 changes: 9 additions & 5 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
<label for="proxyCommand"></label>
</td>
<td>
<div class="browser-style"><input class="option" id="proxyCommand" type="text"></div>
<div class="browser-style"><input class="option" id="proxyCommand" type="text"
placeholder="http://127.0.0.1:1337"></div>
</td>
</tr>
<tr>
Expand All @@ -81,15 +82,18 @@
<label for="customCommand"></label>
</td>
<td>
<div class="browser-style"><input class="option" id="customCommand" type="text"></div>
<div class="browser-style"><input class="option" id="customCommand" type="text" placeholder="--verbose"></div>
</td>
</tr>
<tr>
<td>
<label for="userCommand"></label><br/><br/ > %useragent%<br/> %referer%<br/> %cookie%<br/> %filename%<br/> %url%<br/>
<label for="userCommand"></label>
</td>
<td>
<div class="browser-style"><input class="option" id="userCommand" type="text" placeholder="usercmd.py %url%"></div>
<div class="browser-style"><input class="option" id="userCommand" type="text" placeholder="usercmd.py %url%">
<div style="display: inline; cursor: help;"><span id="userCommandTip"
style="font-weight: bold; margin: auto 1vw;">?</span></div>
</div>
</td>
</tr>
</tbody>
Expand All @@ -98,4 +102,4 @@
<script src="options.js"></script>
</body>

</html>
</html>
13 changes: 10 additions & 3 deletions options/options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

const defaultOptions = {
copyMethod: "url",
streamlinkOutput: "file",
Expand All @@ -13,7 +15,7 @@ function checkHeadersPref() {
document.getElementById("customCommand").disabled = false;
document.getElementById("proxyPref").disabled = false;
document.getElementById("proxyCommand").disabled = false;
document.getElementById("userCommand").disabled = true;
document.getElementById("userCommand").disabled = true;

document.getElementById("proxyPref").checked === true
? (document.getElementById("proxyCommand").disabled = false)
Expand All @@ -26,11 +28,11 @@ function checkHeadersPref() {
document.getElementById("proxyCommand").disabled = true;
} else if (document.getElementById("copyMethod").value === "streamlink") {
document.getElementById("streamlinkOutput").disabled = false;
} else if (document.getElementById("copyMethod").value === "user") {
} else if (document.getElementById("copyMethod").value === "user") {
document.getElementById("headersPref").disabled = true;
document.getElementById("customCommand").disabled = true;
document.getElementById("proxyPref").disabled = true;
document.getElementById("proxyCommand").disabled = true;
document.getElementById("proxyCommand").disabled = true;
document.getElementById("userCommand").disabled = false;
}
}
Expand Down Expand Up @@ -129,6 +131,11 @@ document.addEventListener("DOMContentLoaded", () => {
for (let selectOption of selectOptions) {
selectOption.textContent = _(selectOption.value);
}
const spans = document.getElementsByTagName("span");
for (let span of spans) {
//mouseover tooltip
span.parentElement.title = _(span.id);
}

restoreOptions();

Expand Down
Loading

0 comments on commit f99ec93

Please sign in to comment.