alexa_remotectl 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b1f56f3518e257c26d3d00ac9e63dde021474827abb5461fdb11114f95196a2
4
- data.tar.gz: 3dbe1a051f41b9b11f77e0f82c392f90c72d23ee4ba0314cc6ebc3c0deb31adc
3
+ metadata.gz: 769f37b93490b3ab472fea0e8bc15dc1ce3c2e34cb3b4c01ce0ddc6c296fdff9
4
+ data.tar.gz: 66bdfb5add38d18635c34469ebd2a508a152daa76319c043ccfc81c67569781d
5
5
  SHA512:
6
- metadata.gz: ff774816c05f4c379b0563f83ff5b9036161c58975438898723d2460aadbb29fe554fa6b84f6c5c12208fb1e375ccdaccac5d006944b7262c321c9a5b4abe724
7
- data.tar.gz: 236d52c95e7421ee51af2d425523ddb85d193290398b4886bfae7c718a8e16f6b1450a316301dc8a077ba0436d59ecb2b7faa301041865ff179505a3001c3594
6
+ metadata.gz: 50ae6554ebe0f56317439880759316c90cfcd154d564cf45db4d517c5471115a10d0f4bad197e74090f96cc952fa9bf8f5f1dd43c0889285c78822022fd488ad
7
+ data.tar.gz: ab6a5c377f4575298d29dbe02592a7a3a20949a7a88326926ab968d725cd2a3e9ec7ccc3cf71aca1300f2fa56dd14964653aff09f9d501538031639ca04fe07f
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- �t$45Y!%=�zo����V�[�X&�F ǡ�wh)���aU%��S�dd(C�߅�/�k�b�r�x�&�J]r��c9k��h)/E� Jz�?4���w_Kc� �h�.+�S�W��/O�8��G���q��XR����%�#yz=2�wg����lJ4~j�VO7Y�xS�FH`�����v�Z��X�&r��%�~�J��t/�
2
- �@\x=M�� �/���,�۶�L�^�� yz*�p ���q��{����9S�����ժ{��*A���VqK��?��)�*�*�oR+Pm[{޼!.Aⓡ��7�S��|�%�F ~�q�8p}������+�E�}�Zn������_/�a �}5���?��y�Kt����-���(Z7;>�O
1
+ .J���0 Q��:�+��t#��{��= jqo�( ��2ऊ��E_�%�o)Q9wƧ��
2
+ �(��'a?Vj-�H���A�L�|��!D%Ս\�˲���<_R`�h��[1YtIOfsr�������f4��]���o ��Ե{
3
+ ���69�jyR�/�F��n�}T�����bT��O̜3�`�1�hy�t�bs�D�A����v�&���#]Pz����鷜IZ�O8�C�1�B�̑��i9��[��SkiFG�#/� ��T籠�y�9�"�-Ω[�(�wdõ��+� q��
4
+ zI��������
@@ -22,14 +22,15 @@ class CodeWizard
22
22
 
23
23
  return 'no curl command found' unless s =~ /curl/
24
24
 
25
- cookie, serialno, type = parse(s)
25
+ cookie, csrf, serialno, type = parse(s)
26
26
 
27
27
  @s =<<EOF
28
28
  require 'alexa_remotectl'
29
29
 
30
30
  cookie = '#{cookie}'
31
+ csrf = '#{csrf}'
31
32
  device = {serialno: '#{serialno}', type: '#{type}'}
32
- alexa = AlexaRemoteCtl.new(cookie: cookie, device: device)
33
+ alexa = AlexaRemoteCtl.new(cookie: cookie, csrf: csrf, device: device)
33
34
  alexa.pause
34
35
  #alexa.play
35
36
  EOF
@@ -50,18 +51,21 @@ EOF
50
51
  serialno = s[/deviceSerialNumber=(\w+)/,1]
51
52
  type = s[/deviceType=(\w+)/,1]
52
53
  cookie = s[/Cookie: ([^']+)/,1]
54
+ csrf = s[/csrf: ([^']+)/,1]
53
55
 
54
- [cookie, serialno, type]
56
+ [cookie, csrf, serialno, type]
55
57
 
56
58
  end
57
59
  end
58
60
 
59
61
  class AlexaRemoteCtl
60
62
 
61
- def initialize(domain: 'alexa.amazon.co.uk', device: {}, cookie: '',
62
- customerid: '')
63
+ # note: Added the Cross-site request forgery (crsf) variable
64
+ #
65
+ def initialize(domain: 'alexa.amazon.co.uk', device: {}, cookie: '', customerid: '', csrf: '')
63
66
 
64
67
  @domain, @device, @cookie, @customerid = domain, device, cookie, customerid
68
+ @csrf = csrf
65
69
 
66
70
  end
67
71
 
@@ -226,7 +230,7 @@ class AlexaRemoteCtl
226
230
  "AppleWebKit/537.36 (KHTML, like Gecko) " +
227
231
  "Chrome/101.0.4951.64 Safari/537.36"
228
232
  request["X-Requested-With"] = "XMLHttpRequest"
229
- request["csrf"] = "-990908140"
233
+ request["csrf"] = @csrf
230
234
  request["dnt"] = "1"
231
235
  request["sec-ch-ua"] = "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\""
232
236
  request["sec-ch-ua-mobile"] = "?0"
@@ -288,10 +292,11 @@ class AlexaDevices
288
292
  # note: label can be any identifier you choose e.g. kitchen
289
293
  #
290
294
  def initialize(devicesx=[], devices: devicesx,
291
- domain: 'alexa.amazon.co.uk', cookie: '', customerid: '')
295
+ domain: 'alexa.amazon.co.uk', cookie: '', customerid: '',
296
+ csrf: '')
292
297
 
293
298
  @devices, @domain, @cookie = devices, domain, cookie
294
- @customerid = customerid
299
+ @customerid, @csrf = customerid, csrf
295
300
 
296
301
  end
297
302
 
@@ -351,7 +356,7 @@ class AlexaDevices
351
356
  def get_alexa(device)
352
357
 
353
358
  AlexaRemoteCtl.new(cookie: @cookie, device: device,
354
- customerid: @customerid)
359
+ customerid: @customerid, csrf: @csrf)
355
360
  end
356
361
 
357
362
  end
data.tar.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- W2f���Kv��/-k8�嘯�
2
- d��{�S�Uq�'�ʆ�FE���e"��H��&��~���ҡ������
3
- �����S:�HͯƖ���
1
+ �Z�?.
2
+ V�{��Ȏ��d��ïAr�Ѯp
3
+ �z�%7�9GA�A���f�y�8*a���y����R��
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexa_remotectl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file