You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lbry1.js 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. clog = console.log
  2. lbry_iglob = {
  3. new_int_orig:[
  4. "https://api.lbry.com/user/new",
  5. {
  6. "method": "POST",
  7. "headers": {
  8. "Content-Type": "application/x-www-form-urlencoded"
  9. },
  10. "body": "auth_token=&language=en&app_id=odyseecom692EAWhtoqDuAfQ6KHMXxFxt8tkhmt7sfprEMHWKjy5hf6PwZcHDV542V"
  11. },
  12. ],
  13. new_int:[
  14. "/ign4/indx/ws_dev/new.js",
  15. {
  16. "method": "GET",
  17. // "method": "POST",
  18. "headers": {
  19. "Content-Type": "application/x-www-form-urlencoded"
  20. },
  21. // "body": "auth_token=&language=en&app_id=odyseecom692EAWhtoqDuAfQ6KHMXxFxt8tkhmt7sfprEMHWKjy5hf6PwZcHDV542V"
  22. },
  23. ],
  24. replace_fetch:{
  25. "https://api.lbry.com/user/new":{
  26. nt:[
  27. "/ign4/indx/ws_dev/new.js",
  28. {
  29. "method": "GET",
  30. // "method": "POST",
  31. "headers": {
  32. "Content-Type": "application/x-www-form-urlencoded"
  33. },
  34. // "body": "auth_token=&language=en&app_id=odyseecom692EAWhtoqDuAfQ6KHMXxFxt8tkhmt7sfprEMHWKjy5hf6PwZcHDV542V"
  35. },
  36. ],
  37. },
  38. "https://api.lbry.com/file/list_filtered?auth_token=":{
  39. nt:[
  40. "/ign4/libs/list_filtered.json?auth_token=",
  41. {
  42. "method": "GET"
  43. }
  44. ],
  45. },
  46. "https://api.lbry.com/file/list_blocked?auth_token=":{
  47. nt:[
  48. "/ign4/libs/list_blocked.json?auth_token=",
  49. {
  50. "method": "GET"
  51. }
  52. ],
  53. },
  54. },
  55. }
  56. function maybe_replace_t(t){
  57. clog("maybe_replace_t2:",t,t[0])
  58. if (t[0] in lbry_iglob.replace_fetch ){
  59. clog("maybe_replace_t t[0]",t)
  60. return lbry_iglob.replace_fetch[t[0]].nt
  61. }
  62. return t
  63. }
  64. rfns2_ = {
  65. rfn_apply(){
  66. clog("RFN:apply")
  67. return Reflect.apply(...arguments)
  68. },
  69. rfn_construct(){
  70. clog("RFN:construct")
  71. return Reflect.construct(...arguments)
  72. },
  73. rfn_defineProperty(){
  74. clog("RFN:defineProperty")
  75. return Reflect.defineProperty(...arguments)
  76. },
  77. rfn_deleteProperty(){
  78. clog("RFN:deleteProperty")
  79. return Reflect.deleteProperty(...arguments)
  80. },
  81. rfn_get(){
  82. clog("RFN:get",[...arguments])
  83. return Reflect.get(...arguments)
  84. },
  85. rfn_getOwnPropertyDescriptor(){
  86. clog("RFN:getOwnPropertyDescriptor")
  87. return Reflect.getOwnPropertyDescriptor(...arguments)
  88. },
  89. rfn_getPrototypeOf(){
  90. clog("RFN:getPrototypeOf")
  91. return Reflect.getPrototypeOf(...arguments)
  92. },
  93. rfn_has(){
  94. clog("RFN:has")
  95. return Reflect.has(...arguments)
  96. },
  97. rfn_isExtensible(){
  98. clog("RFN:isExtensible")
  99. return Reflect.isExtensible(...arguments)
  100. },
  101. rfn_ownKeys(){
  102. clog("RFN:ownKeys")
  103. return Reflect.ownKeys(...arguments)
  104. },
  105. rfn_preventExtensions(){
  106. clog("RFN:preventExtensions")
  107. return Reflect.preventExtensions(...arguments)
  108. },
  109. rfn_set(){
  110. clog("RFN:set")
  111. return Reflect.set(...arguments)
  112. },
  113. rfn_setPrototypeOf(){
  114. clog("RFN:setPrototypeOf")
  115. return Reflect.setPrototypeOf(...arguments)
  116. },
  117. }
  118. Response_orig = Response
  119. Response_p = new Proxy(Response,rfns2_)
  120. // Response = new Proxy(Response,rfns2_)
  121. rfns =rfns2_
  122. rprox2 = {
  123. apply: rfns.rfn_apply,
  124. construct: rfns.rfn_construct,
  125. defineProperty: rfns.rfn_defineProperty,
  126. deleteProperty: rfns.rfn_deleteProperty,
  127. get: rfns.rfn_get,
  128. getOwnPropertyDescriptor: rfns.rfn_getOwnPropertyDescriptor,
  129. getPrototypeOf: rfns.rfn_getPrototypeOf,
  130. has: rfns.rfn_has,
  131. isExtensible: rfns.rfn_isExtensible,
  132. ownKeys: rfns.rfn_ownKeys,
  133. preventExtensions: rfns.rfn_preventExtensions,
  134. set: rfns.rfn_set,
  135. setPrototypeOf: rfns.rfn_setPrototypeOf,
  136. }
  137. function proxy_rsp(t){
  138. clog("rfn.")
  139. var ret =new Proxy(t,rprox2)
  140. // ret.z
  141. return ret
  142. }
  143. /*
  144. {
  145. "method": "POST",
  146. "headers": {
  147. "Content-Type": "application/x-www-form-urlencoded"
  148. },
  149. "body": "auth_token=&language=en&app_id=odyseecom692EAWhtoqDuAfQ6KHMXxFxt8tkhmt7sfprEMHWKjy5hf6PwZcHDV542V"
  150. }
  151. */
  152. // https://api.lbry.com/user/new
  153. /*
  154. [
  155. "https://api.lbry.tv/api/v1/proxy?m=status",
  156. {
  157. "method": "POST",
  158. "headers": {
  159. "Content-Type": "application/json-rpc"
  160. },
  161. "body": "{\"jsonrpc\":\"2.0\",\"method\":\"status\",\"params\":{},\"id\":1619731308841}"
  162. }
  163. ]
  164. [
  165. "https://api.lbry.com/file/list_filtered?auth_token=",
  166. {
  167. "method": "GET"
  168. }
  169. ]
  170. [
  171. "https://api.lbry.com/file/list_blocked?auth_token=",
  172. {
  173. "method": "GET"
  174. }
  175. ]
  176. */