Class: YoutubeAudio::Decipher
- Inherits:
-
Object
- Object
- YoutubeAudio::Decipher
- Defined in:
- lib/youtube_audio/decipher.rb
Constant Summary collapse
- URL =
'https://www.youtube.com'
Instance Attribute Summary collapse
-
#script_player_url ⇒ Object
readonly
Returns the value of attribute script_player_url.
Instance Method Summary collapse
- #decipher(cipher) ⇒ Object
-
#initialize(script_player_url) ⇒ Decipher
constructor
A new instance of Decipher.
Constructor Details
#initialize(script_player_url) ⇒ Decipher
Returns a new instance of Decipher.
8 9 10 |
# File 'lib/youtube_audio/decipher.rb', line 8 def initialize(script_player_url) @script_player_url = script_player_url end |
Instance Attribute Details
#script_player_url ⇒ Object (readonly)
Returns the value of attribute script_player_url.
5 6 7 |
# File 'lib/youtube_audio/decipher.rb', line 5 def script_player_url @script_player_url end |
Instance Method Details
#decipher(cipher) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/youtube_audio/decipher.rb', line 13 def decipher(cipher) klass = extract_decode_function_handler miniracer_klass = miniracer_context miniracer_klass.eval(klass.cipher_helpers_object) miniracer_klass.eval("var #{klass.decipher_function}") miniracer_klass.eval("#{klass.decryption_function}('#{cipher}')") end |