Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


mosb3rgler last won the day on May 23 2019

mosb3rgler had the most liked content!

mosb3rgler's Achievements


Member (2/5)



  1. the issue is the api key is only delivered through the OPTIONS, the bearer i can generate no problem and insert. but i don't seem to have any other way to get the api key value without the OPTIONS header that is shown first. so if that is actually the only way and we know we only need specific headers and we know the naming convention of the headers, is it still not possible to use the OPTIONS to accomplish this, not sure how to approach that 1specific value or any of the instances on other projects where it only delivers specific values through OPTIONS.
  2. Hey everyone, so im trying to utilize a systems OPTION command send prior to the POST command, the OPTION command will for example state that it would like to request specific headers. im trying to perform this to get the headers needed before the POST command im trying to execute, the values are required for the POST command i need to perform to get a response. The URL in question would be: https://media-entitlement.mlb.com/api/v3/jwt?os=windows&did=ffeae86c-9447-4bac-a021-caad0c02c605&appname=mlbtv_web Request method: OPTIONS (to get required headers): Host: media-entitlement.mlb.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0 Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Access-Control-Request-Method: GET Access-Control-Request-Headers: authorization,x-api-key Referer: https://www.mlb.com/tv/g566992/v4db99327-63d3-4f23-a94d-a1ff465e177d Origin: https://www.mlb.com Connection: keep-alive Cache-Control: max-age=0 then a post command is performed just after which retrieves the values originally requested by the OPTIONS command prior to the POST: Host: media-entitlement.mlb.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0 Accept: */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Referer: https://www.mlb.com/tv/g566992/v4db99327-63d3-4f23-a94d-a1ff465e177d x-api-key: arBv5yTc359fDsqKdhYC41NZnIFZqEkY5Wyyn9uA Authorization: bearer eyJraWQiOiJUNXQteURjQ2pQeWg0anBpOF9Dcm5YR2hkR0hjLUhLb1F6cmo5X3QyeENZIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULjVudzBlOElzZlFLaDhHYWE1Qzc1blMyQ1FwWVpkSHVCdVFhVFd0a25CY0EiLCJpc3MiOiJodHRwczovL2lkcy5tbGIuY29tL29hdXRoMi9hdXMxbTA4OHlLMDdub0JmaDM1NiIsImF1ZCI6ImFwaTovL21sYl9kZWZhdWx0IiwiaWF0IjoxNTYwNDcwNjYyLCJleHAiOjE1NjA1NTcwNjIsImNpZCI6IjBvYXA3d2E4NTdqY3ZQbFo1MzU1IiwidWlkIjoiMDB1N2psN2UxSjlhM0JGVVMzNTYiLCJzY3AiOlsib3BlbmlkIiwiZW1haWwiXSwic3ViIjoicmF5bmFqcGFudGhlckBtc24uY29tIiwiaXBpZCI6IjY3NzIwMjEiLCJndWlkIjoiNjc1ZmYxNzdiZTE2NTE0ZDRjYmYxNmVhOTNmYzg3NTcifQ.YDW-3f8T5ZcHg2wTvyAfHX0A5LdijP3lgvoSTKla_hBoE5_RBwU9aUYinrATQDNg8d_6wQkCo-ejAX_t9SGE7IGE8j-FE-oQlqIz2ubG7XDz3-84l5zJrSZ0QwxPoGOXMt_0-9DkZ_V4uzISGhN_pI_HnUr26IW-8sf0XK3yNSBOJLQnqx-iZ6HtiUEuI9Qi2T2J2zZuFSnDytxGlqmjC1mAyf0inLdr1LIuUfDayak3G5-YnP91z-8f2_k8QwSVw9IMg_bOCUaMD9suu67VaCU5EnREgZoTxCKEUIIKeJtlSCx6VgW_oXbOguRO0L0BlMR6eHDX9pDt0CgPftfxTw Origin: https://www.mlb.com Connection: keep-alive Cache-Control: max-age=0 Now Generally speaking, i fully understand their authorization etc. but this specific set of values seem only used in this one situation, they use bam-sdk which i understand pretty well. but needless to say this authorization bearer, and api-key value only seem generated via the initial OPTIONS grab in browser. so in summary i need to understand how these OPTIONS commands can be utilized to store the required headers as a variable which can be used in the POST command. Thanks in advance for your time and energy responding. mosb3rgler
  3. actually, your explaination triggered the solution i nested 1 inside the other one, and used }} to close at the end, and got the results i was after very much thanks for the nudge bud. you guys are excellent teachers, you just know the right comments to make to make us take another look at it.
  4. ahh i see what your saying now. but my question is how would it look when your factoring in multiple indexes with in games. because the way i have the foreach example setup im noting the initial index 0, so im not sure how to have it look to all indexes.
  5. sorry about that i edited it to unlisted you can see it now.
  6. ok, so i noticed i change the index after games to 1 or 2 etc, and then otherwise it shows everything i need it too.. is there an approach that can check each of the index and posting similar to if it was all with in the same array.
  7. Hey there folks, Im trying to get a foreach loop working correctly from a json source epg heres my code: https://pastebin.com/FjHj1EF6 Here is the current output, which.. while correct is only the first instance of these values i wanted using the foreach loop, i would love any tips on why my approach failed and to be pointed in the right direction. While it has to be included: $url = "https://mywebsite.fake/mlb.php?id={$arr['games'][0]["gamePk"]}"; this value isn't related to the assistance im asking for. that will work for my purposes later. but for now i just need to understand the issue with the foreach loop. Thanks in advance for your thoughtful response. mosb3rgler
  8. Evening folks, I'm interested in dumping the Request Cookies from this url: https://plus.espn.com/en/sdk-data/#id=btm_activity_jwpcbyve but i have been reading, and the only approach i found didn't work correctly. Was hoping some of you could share a few of your approaches to getting the cookies to the URL. again specifically from the request headers because they contain the value I'm looking for.
  9. i was able to edit correctly and get the characters to look how i wanted, i used start_time and start_date to get the version of those i needed, and i even added timezone for clearification further on the automation needs moving forward for reference. So i see how you used $i the i believe its $i++ was that to say count incrementally higher ? and if so is this same thing possible only using a-z intead of 0-9
  10. Thank you very much for your time and examples, I'm going to deep dive into your code and examples and see if I can play with that array and dig around to get different responses for practice. and I'll also investigate the datetime class details and see if there's a way to break it down further and make it a more readable format. Really impressed with your ability to explain in great detail. very glad i accidentally bumped into this place, and I plan to be a long time frequent user of the forums here
  11. lastly i need time like you showed me, but i also need the date, because these events are being automated, so it needs to know exactly when to begin and have that reference in later stages.
  12. hey there, thank you so much for your incredibly thoughtful response and examples, i did give a whirl to see how the code would look online and my attempt word wraps all the results jumbled up could you tell me why this might be ? http://prntscr.com/ns2gch and also would it be possible to do like this: 1.) 25111 for the stream id's being listed. im not seeing where the numbering is being done and i have a feeling popping the odd ) character without understanding where it can go might break something.
  13. I noticed an error, which i have fixed on Line 6 not using a variable. however the output is still not working for the 3rd level so heres the php code with that correction to examine: https://pastebin.com/zJA5KTmR Thanks in advance for any of your valuable time you spend helping.
  14. Hey i just tested what you suggested. and it actually wasn't quite what i meant, so yes i need 3 levels deep, however its within a foreach loop so i wont know the expected values, i just know the container its and i need to retrieve whats inside of each instance of it. it works for the values which are 2 levels deep just fine, but the 1 i need that i cant get is 3 levels deep. here's what i tried. and if you could direct me on how to proceed it would be sincerely appreciated. Heres the php file im working on: https://pastebin.com/e3AgH6xL The only value still needing to be scraped is the stream_id which is 3 levels deep in the json: $stream_id = $json['data']['live_event']['stream_list']['stream_id']; im not using the above syntax just trying to provide a quick example of the 3 levels for your reference in responding in a timely manor. Thanks in advance for anyone who has the time to answer and correct my mistake.
  15. Thank you very much for taking your valuable free time to answer me. I believe i understand your example in relationship to what i provided. I'll give it a try after work and ill report back. You guys are nice and helpful here I'll continue to frequent. Mosb3rgler
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.