Open ghost opened 9 years ago
I guess this means that cookies need to be passed
A possible solution would look like this:
CloudFront-Signature: IfKJLfiFPqMtOiPm5si255wFt9-Ez1BGF9qBD060gX3lg1sPXS2iI~VZV2zZrKRhdMrynN6IXpgvZmZ~-JzoPIdxkkvTwToIfHjy7Zrx~QLx28O2F3HkOVPKggef94IY6LreTQpEEhzkPIQ4~eFdD5ScG7HGKQBwaM7DQvFAEWLZBazJ3Bpc8pCE2122AAWCswe0d-fsvYcI3MceUOl6zhR3ugihr9ixKALNoLFBR0MrNnJ7q-6iS~QJiUtudS7CcAHMtrC0niXo8KFC63MVAlYEc5v46IzEGBjYLLCznioAd2L9iuMSkI6j31exmXGb1dVogKKkbtAFEGPe7IOZeA__
CloudFront-Policy: eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L3VaYzJOZ1Q5Q1puZ05TR29Hcy1VM1VmcU05RkZMdW9QbldYZHdPVjJqeGtnQzRmdk1LY29HUmxZcnYxOEpfU0pieVRFTlg1VnBZOFFxQVhLLUgyM2JBPT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1MjQ1OTk4fX19XX0_
CloudFront-Key-Pair-Id: APKAIHCXHHQVRTVSFRWQ
livestreamer --http-header "Cookie=CloudFront-Signature=IfKJLfiFPqMtOiPm5si255wFt9-Ez1BGF9qBD060gX3lg1sPXS2iI~VZV2zZrKRhdMrynN6IXpgvZmZ~-JzoPIdxkkvTwToIfHjy7Zrx~QLx28O2F3HkOVPKggef94IY6LreTQpEEhzkPIQ4~eFdD5ScG7HGKQBwaM7DQvFAEWLZBazJ3Bpc8pCE2122AAWCswe0d-fsvYcI3MceUOl6zhR3ugihr9ixKALNoLFBR0MrNnJ7q-6iS~QJiUtudS7CcAHMtrC0niXo8KFC63MVAlYEc5v46IzEGBjYLLCznioAd2L9iuMSkI6j31exmXGb1dVogKKkbtAFEGPe7IOZeA__; CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L3VaYzJOZ1Q5Q1puZ05TR29Hcy1VM1VmcU05RkZMdW9QbldYZHdPVjJqeGtnQzRmdk1LY29HUmxZcnYxOEpfU0pieVRFTlg1VnBZOFFxQVhLLUgyM2JBPT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1MjQ1OTk4fX19XX0_; CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ" "hls://https://replay.periscope.tv/uZc2NgT9CZngNSGoGs-U3UfqM9FFLuoPnWXdwOV2jxkgC4fvMKcoGRlYrv18J_SJbyTENX5VpY8QqAXK-H23bA==/playlist.m3u8" best
livestreamer --http-header "Cookie=CloudFront-Signature=IfKJLfiFPqMtOiPm5si255wFt9-Ez1BGF9qBD060gX3lg1sPXS2iI~VZV2zZrKRhdMrynN6IXpgvZmZ~-JzoPIdxkkvTwToIfHjy7Zrx~QLx28O2F3HkOVPKggef94IY6LreTQpEEhzkPIQ4~eFdD5ScG7HGKQBwaM7DQvFAEWLZBazJ3Bpc8pCE2122AAWCswe0d-fsvYcI3MceUOl6zhR3ugihr9ixKALNoLFBR0MrNnJ7q-6iS~QJiUtudS7CcAHMtrC0niXo8KFC63MVAlYEc5v46IzEGBjYLLCznioAd2L9iuMSkI6j31exmXGb1dVogKKkbtAFEGPe7IOZeA__; CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L3VaYzJOZ1Q5Q1puZ05TR29Hcy1VM1VmcU05RkZMdW9QbldYZHdPVjJqeGtnQzRmdk1LY29HUmxZcnYxOEpfU0pieVRFTlg1VnBZOFFxQVhLLUgyM2JBPT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1MjQ1OTk4fX19XX0_; CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ" "hls://https://replay.periscope.tv/uZc2NgT9CZngNSGoGs-U3UfqM9FFLuoPnWXdwOV2jxkgC4fvMKcoGRlYrv18J_SJbyTENX5VpY8QqAXK-H23bA==/playlist.m3u8" best
[cli][info] Found matching plugin stream for URL hls://https://replay.periscope.tv/uZc2NgT9CZngNSGoGs-U3UfqM9FFLuoPnWXdwOV2jxkgC4fvMKcoGRlYrv18J_SJbyTENX5VpY8QqAXK-H23bA==/playlist.m3u8
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (hls)
[cli][info] Starting player: "C:\Program Files (x86)\Video\MPC-HC\mpc-hc.exe"
Looks like those values (except the key-pair-id one) change with each request/invocation. I tested with livestreamer 1.12.2 (latest available on gentoo) but I cannot get it to work by manually inputting the values that it spits out the first time it fails. (because they change with each invocation) EDIT2: ignore everything below - I was failling hard.
Example:
$ livestreamer --stream-url --http-header 'User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17; Cookie=CloudFront-Signature=Le1OVIVjvrDuzOHW0C6sgSb-~2lYWdoHLr7vRjX5Avwizpxr9kTyf8lUGvFZ2wUAFxA45C8BEvR2vgoIiGVMRdOX6sMcLlVoRD-nYWv~tyyAp6mmcl3FtHFUQGS0ykpapA-Nsn1H2W9a4pHBhVs--ZSJb9KYpcX6QGIyuReLdD6O8f3gLwr-G5cHesKlskrBgulehe-OFxfAzoLTatxa5KA3w7MqTEOBc3ouVkEYiBzrN7ogji9Nc9H14JeyhTWjMFyfLL5aeeYgyDBv~c0bS4eqU5n9jD9Um0MQ1g8BYwKMSrSBA3vPKxedB527AFmYH3-jSUpkrUBR23yQEe1eeQ__; CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L29uRGpuOGpTUC1uU0ZuSTdMUzdWcWNBZWJ2eUxEel9IVDRHbFdQVXY4Q3VXSWlBRUZEbGgxbmhkRmhYeWtBZk9TY2xtVHlMZXVEUmFLQVhMeVFPaGV3PT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1NDIzODU4fX19XX0_; CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ' --retry-open 1 --default-stream best -o '/tmp/periscope_Tue Oct 20 12:49:22 CEST 2015.mp2t' -- https://t.co/fErQ55pgN7
Saving file will be: '/tmp/periscope_Tue Oct 20 12:49:22 CEST 2015.mp2t'
error: Unable to validate JSON: Key 'hls_url' not found in {'signer_token': '', 'participant_index': 0, 'session': '1445338174452047295', 'replay_url': 'https://replay.periscope.tv/onDjn8jSP-nSFnI7LS7VqcAebvyLDz_HT4GlWPUv8CuWIiAEFDlh1nhdFhXykAfOSclmTyLeuDRaKAXLyQOhew==/playlist.m3u8', 'readonly': True, 'publisher': '', 'cookies': [{'RawExpires': '', 'Value': 'eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L29uRGpuOGpTUC1uU0ZuSTdMUzdWcWNBZWJ2eUxEel9IVDRHbFdQVXY4Q3VXSWlBRUZEbGgxbmhkRmhYeWtBZk9TY2xtVHlMZXVEUmFLQVhMeVFPaGV3PT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1NDI0NTc0fX19XX0', 'Raw': '', 'Expires': '0001-01-01T00:00:00Z', 'Domain': '.periscope.tv', 'Name': 'CloudFront-Policy', 'HttpOnly': False, 'MaxAge': 0, 'Path': '/', 'Secure': False, 'Unparsed': None}, {'RawExpires': '', 'Value': 'dsaw2QcljL1MLmDDtssxA5rQbAsWHvBx3lFvlcyVQ90rAZVj6ETPRFuwsVz7FwFv9alfpaaDZr-~-sW3lcS7AVSHFCO8Ig3hpn2LUTwGwRw5bauS9ZgXtO5QFFvi6Yzbb4O70g5RovIyJNYxyVxGNsuuKlyDCUwy6Ba6O8wLbHXt19w66MLuvPZBn7bFe-E3Wnr-mqC4eCIfJpKNLeGMFBmUWxttnTmTAAXvWlFfcGm5dwVGdvdkgMD-GMiilOsPELHpCyRHRXpBpfkF37RWMHHeRpRShRJoXwnlqvUBitEphVnOHnOuWi5K9gF6v4IxA2TEd3KcnVKhKa3Eue13Og__', 'Raw': '', 'Expires': '0001-01-01T00:00:00Z', 'Domain': '.periscope.tv', 'Name': 'CloudFront-Signature', 'HttpOnly': False, 'MaxAge': 0, 'Path': '/', 'Secure': False, 'Unparsed': None}, {'RawExpires': '', 'Value': 'APKAIHCXHHQVRTVSFRWQ', 'Raw': '', 'Expires': '0001-01-01T00:00:00Z', 'Domain': '.periscope.tv', 'Name': 'CloudFront-Key-Pair-Id', 'HttpOnly': False, 'MaxAge': 0, 'Path': '/', 'Secure': False, 'Unparsed': None}], 'subscriber': 'sub-c-642f220c-d70e-11e3-93e0-02ee2ddab7fe', 'access_token': '', 'should_verify_signature': True, 'channel': 'onDjn8jSP-nSFnI7LS7VqcAebvyLDz_HT4GlWPUv8CuWIiAEFDlh1nhdFhXykAfOSclmTyLeuDRaKAXLyQOhew==', 'endpoint': '', 'type': 'StreamTypeReplay', 'should_log': False, 'signer_key': 'MIIBVDCB+qADAgECAhEAr9iXnwTU3OnVQkAXssL8hjAKBggqhkjOPQQDAjAXMRUwEwYDVQQKEwxQZXJpc2NvcGUgQ28wHhcNMTUxMDIwMDQxOTE2WhcNMTUxMDIxMDQxOTE2WjAXMRUwEwYDVQQKEwxQZXJpc2NvcGUgQ28wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASrGRcprIkjzgQIMDsDueXo8ZMP9U9eF+5E8vO7f6mJGIbBJK19WOBKqUsLNx9ndJyRbAKsBLV56zbTXxgj9QkUoycwJTAOBgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYIKoZIzj0EAwIDSQAwRgIhANYl9wDcaWBVjPPsA8fyTqPqctIQk1ncN2OUPeCcAllpAiEAsAfRnsloVBCpWyYixNWy/QXaQFTadwXvPprO2Ah0qbo=', 'auth_token': 'f0dsyqHM1BA5074LabVQ_1RbnFhjtF8gHu4Vb03j5o0='}
EDIT: forgot to show the result when using the hls url
livestreamer --stream-url --http-header 'User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17; Cookie=CloudFront-Signature=Le1OVIVjvrDuzOHW0C6sgSb-~2lYWdoHLr7vRjX5Avwizpxr9kTyf8lUGvFZ2wUAFxA45C8BEvR2vgoIiGVMRdOX6sMcLlVoRD-nYWv~tyyAp6mmcl3FtHFUQGS0ykpapA-Nsn1H2W9a4pHBhVs--ZSJb9KYpcX6QGIyuReLdD6O8f3gLwr-G5cHesKlskrBgulehe-OFxfAzoLTatxa5KA3w7MqTEOBc3ouVkEYiBzrN7ogji9Nc9H14JeyhTWjMFyfLL5aeeYgyDBv~c0bS4eqU5n9jD9Um0MQ1g8BYwKMSrSBA3vPKxedB527AFmYH3-jSUpkrUBR23yQEe1eeQ__; CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L29uRGpuOGpTUC1uU0ZuSTdMUzdWcWNBZWJ2eUxEel9IVDRHbFdQVXY4Q3VXSWlBRUZEbGgxbmhkRmhYeWtBZk9TY2xtVHlMZXVEUmFLQVhMeVFPaGV3PT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1NDIzODU4fX19XX0_; CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ' --retry-open 1 --default-stream best -o '/tmp/periscope_Tue Oct 20 12:52:15 CEST 2015.mp2t' -- hls://https://replay.periscope.tv/onDjn8jSP-nSFnI7LS7VqcAebvyLDz_HT4GlWPUv8CuWIiAEFDlh1nhdFhXykAfOSclmTyLeuDRaKAXLyQOhew==/playlist.m3u8
Saving file will be: '/tmp/periscope_Tue Oct 20 12:52:15 CEST 2015.mp2t' https://replay.periscope.tv/onDjn8jSP-nSFnI7LS7VqcAebvyLDz_HT4GlWPUv8CuWIiAEFDlh1nhdFhXykAfOSclmTyLeuDRaKAXLyQOhew==/playlist.m3u8
I actually had a better example, I'm not sure why this one didn't report the values for CloudFront-Signature, CloudFront-Policy and CloudFront-Key-Pair-Id when it failed above.
Here it my better example which does report them: $ livestreamer --stream-url --http-header 'User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17; Cookie=CloudFront-Signature=Le1OVIVjvrDuzOHW0C6sgSb-~2lYWdoHLr7vRjX5Avwizpxr9kTyf8lUGvFZ2wUAFxA45C8BEvR2vgoIiGVMRdOX6sMcLlVoRD-nYWv~tyyAp6mmcl3FtHFUQGS0ykpapA-Nsn1H2W9a4pHBhVs--ZSJb9KYpcX6QGIyuReLdD6O8f3gLwr-G5cHesKlskrBgulehe-OFxfAzoLTatxa5KA3w7MqTEOBc3ouVkEYiBzrN7ogji9Nc9H14JeyhTWjMFyfLL5aeeYgyDBv~c0bS4eqU5n9jD9Um0MQ1g8BYwKMSrSBA3vPKxedB527AFmYH3-jSUpkrUBR23yQEe1eeQ_; CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L29uRGpuOGpTUC1uU0ZuSTdMUzdWcWNBZWJ2eUxEel9IVDRHbFdQVXY4Q3VXSWlBRUZEbGgxbmhkRmhYeWtBZk9TY2xtVHlMZXVEUmFLQVhMeVFPaGV3PT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1NDIzODU4fX19XX0; CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ' --retry-open 1 --default-stream best -o '/tmp/periscope_Tue Oct 20 12:55:16 CEST 2015.mp2t' -- https://t.co/hMMPIoaGW2
error: Unable to validate JSON: Key 'hls_url' not found in {'access_token': '', 'channel': 'YG5M374FrEG7myW4IH_vfD224yJP84U9RTC86pYBmRVtkGrONRNk0MHm4FfvkhbDg0XVQA0_ObOWkF6MwYMLXA==', 'type': 'StreamTypeReplay', 'publisher': '', 'subscriber': 'sub-c-642f220c-d70e-11e3-93e0-02ee2ddab7fe', 'should_log': False, 'read_only': True, 'replay_url': 'https://replay.periscope.tv/YG5M374FrEG7myW4IH_vfD224yJP84U9RTC86pYBmRVtkGrONRNk0MHm4FfvkhbDg0XVQA0_ObOWkF6MwYMLXA==/playlist.m3u8', 'participant_index': 0, 'auth_token': 'Er-EGJAT5K4TSSxU3D4VjcNxlcGenlaBBmybUyIugB4=', 'signer_token': '', 'should_verifysignature': True, 'endpoint': '', 'cookies': [{'Secure': False, 'Value': 'eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L1lHNU0zNzRGckVHN215VzRJSF92ZkQyMjR5SlA4NFU5UlRDODZwWUJtUlZ0a0dyT05STmswTUhtNEZmdmtoYkRnMFhWUUEwX09iT1drRjZNd1lNTFhBPT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1NDI0OTI3fX19XX0', 'MaxAge': 0, 'Raw': '', 'Path': '/', 'HttpOnly': False, 'Domain': '.periscope.tv', 'Unparsed': None, 'Expires': '0001-01-01T00:00:00Z', 'Name': 'CloudFront-Policy', 'RawExpires': ''}, {'Secure': False, 'Value': 'UekEq7rH8A-hb2~JuR9f9e6voWF2v~ocjO7kGygUFLEMLU0gpXrzlKoN7WeNVE2cRSNyAogWRWcnFSWvyfWpUUrWW6mmqnhKGU1JihjdvEg9PAOejF8TGFV1nfG97fRzJ4pCYVHrCqJ-LzEqfnhVSLKwqlz1n64A54cCBxYKvjdNBAHpBQddmoYWxpUurI6X~d6ne92rDWdVeFVypL2kkLu46KJX5TdRSJxhwkDo2PgItLP1pDTk3RhyKwkrn9kAB0zncJbBquHnFN8yuneV4Dk~Z95~XTKDZZmTu9XpU2lFZUPIKAUvALjzIVxG2YgZVbYW2NY8nXPaMDexRt7Tew__', 'MaxAge': 0, 'Raw': '', 'Path': '/', 'HttpOnly': False, 'Domain': '.periscope.tv', 'Unparsed': None, 'Expires': '0001-01-01T00:00:00Z', 'Name': 'CloudFront-Signature', 'RawExpires': ''}, {'Secure': False, 'Value': 'APKAIHCXHHQVRTVSFRWQ', 'MaxAge': 0, 'Raw': '', 'Path': '/', 'HttpOnly': False, 'Domain': '.periscope.tv', 'Unparsed': None, 'Expires': '0001-01-01T00:00:00Z', 'Name': 'CloudFront-Key-Pair-Id', 'RawExpires': ''}], 'signer_key': 'MIIBUjCB+qADAgECAhEA194KMy/WDO4CvXCrPaDl8DAKBggqhkjOPQQDAjAXMRUwEwYDVQQKEwxQZXJpc2NvcGUgQ28wHhcNMTUxMDIwMDQxOTQ1WhcNMTUxMDIxMDQxOTQ1WjAXMRUwEwYDVQQKEwxQZXJpc2NvcGUgQ28wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASrGRcprIkjzgQIMDsDueXo8ZMP9U9eF+5E8vO7f6mJGIbBJK19WOBKqUsLNx9ndJyRbAKsBLV56zbTXxgj9QkUoycwJTAOBgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYIKoZIzj0EAwIDRwAwRAIgWnxkYTLsS2/69bZKlHZV8nmXHWChy0nP0w6WaqXgQScCIDzpNvjwo2104Nma/JT/bFg6Tx2zcFzNZBCdYL4ZTQ/u', 'session': '1445338527890813219'}
EDIT2: Oh wait, it didn't show them this time ... and I guess it's because I already pass them in http-header!
Nevermind all this, I don't know what I'm doing anyway.
EDIT3: Those values only show up when I'm not passing CloudFront-Key-Pair-Id, $ livestreamer --stream-url --http-header 'User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17' --retry-open 1 --default-stream best -o '/tmp/periscope_Tue Oct 20 13:03:15 CEST 2015.mp2t' -- https://t.co/hMMPIoaGW2
error: Unable to validate JSON: Key 'hls_url' not found in {'read_only': True, 'subscriber': 'sub-c-642f220c-d70e-11e3-93e0-02ee2ddab7fe', 'publisher': '', 'signer_token': '', 'access_token': '', 'channel': 'YG5M374FrEG7myW4IH_vfD224yJP84U9RTC86pYBmRVtkGrONRNk0MHm4FfvkhbDg0XVQA0_ObOWkF6MwYMLXA==', 'replay_url': 'https://replay.periscope.tv/YG5M374FrEG7myW4IH_vfD224yJP84U9RTC86pYBmRVtkGrONRNk0MHm4FfvkhbDg0XVQA0_ObOWkF6MwYMLXA==/playlist.m3u8', 'participant_index': 0, 'should_verify_signature': True, 'endpoint': '', 'signerkey': 'MIIBUzCB+qADAgECAhEA0KtU3jxOwgQDgqrkN+UMBTAKBggqhkjOPQQDAjAXMRUwEwYDVQQKEwxQZXJpc2NvcGUgQ28wHhcNMTUxMDIwMDQxOTE5WhcNMTUxMDIxMDQxOTE5WjAXMRUwEwYDVQQKEwxQZXJpc2NvcGUgQ28wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASrGRcprIkjzgQIMDsDueXo8ZMP9U9eF+5E8vO7f6mJGIbBJK19WOBKqUsLNx9ndJyRbAKsBLV56zbTXxgj9QkUoycwJTAOBgNVHQ8BAf8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYIKoZIzj0EAwIDSAAwRQIhAJOt0cP6HtzBCwUoa0rMIgybXNTxi+ICjSbbA0BGPcYUAiBLObo2YTL3PxKmTQqOiwZtJM/9VV2wPQIj1W74oc4eBw==', 'cookies': [{'Expires': '0001-01-01T00:00:00Z', 'Name': 'CloudFront-Policy', 'Value': 'eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L1lHNU0zNzRGckVHN215VzRJSF92ZkQyMjR5SlA4NFU5UlRDODZwWUJtUlZ0a0dyT05STmswTUhtNEZmdmtoYkRnMFhWUUEwX09iT1drRjZNd1lNTFhBPT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1NDI1NDA3fX19XX0', 'MaxAge': 0, 'Raw': '', 'HttpOnly': False, 'Path': '/', 'RawExpires': '', 'Domain': '.periscope.tv', 'Secure': False, 'Unparsed': None}, {'Expires': '0001-01-01T00:00:00Z', 'Name': 'CloudFront-Signature', 'Value': 'Qljyr0YZpxp-vXIV99Zgvhm615QCfd-lRV6GANpz2beF0jHRzMkzstYuUD5xeNYeo78XoJ23Zd1oq3uwhqdtsSdsF1keTXVzELY95nKOb8ZXiVG-TRvId8Fz6TTYfp0nNAu9iKY7earbD~CjtNKuMuj1x78vtq1F8G45aXpN0Cn7Y7fPELo8dQgCLxVEylmki~raFhRqMHrCzuv1edLAmEmpc8Wbs8mbV1vWYc7adLD8CBQgGBgOGTfHx~mN3aAiyfrF~rWEy3RCCDeWoWJnxUt012XF4jgD5a10P6fWwUCr1LZpOjoHK0iZqBSeBmVbuvqTj3yUEu~3ONUkDIW~Bw__', 'MaxAge': 0, 'Raw': '', 'HttpOnly': False, 'Path': '/', 'RawExpires': '', 'Domain': '.periscope.tv', 'Secure': False, 'Unparsed': None}, {'Expires': '0001-01-01T00:00:00Z', 'Name': 'CloudFront-Key-Pair-Id', 'Value': 'APKAIHCXHHQVRTVSFRWQ', 'MaxAge': 0, 'Raw': '', 'HttpOnly': False, 'Path': '/', 'RawExpires': '', 'Domain': '.periscope.tv', 'Secure': False, 'Unparsed': None}], 'auth_token': 'fEQpdAf-Mi2rDvduxQtTE8IK0VzKQyUO_xmcZ09oZGc=', 'session': '1445339006988505134', 'type': 'StreamTypeReplay', 'should_log': False}
EDIT4: wait, rerunning now doesn't show them at all... ok I don't know what I'm doin or what's up, so giving up...
$ livestreamer --stream-url --http-header 'User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17' --retry-open 1 --default-stream best -o '/tmp/periscope_Tue Oct 20 13:05:53 CEST 2015.mp2t' -- https://t.co/hMMPIoaGW2
error: Unable to validate JSON: Key 'hls_url' not found in {'access_token': '', 'signer_key': 'MIIBUjCB+aADAgECAhAqSgw8qTxQgxpUeJKInu6GMAoGCCqGSM49BAMCMBcxFTATBgNVBAoTDFBlcmlzY29wZSBDbzAeFw0xNTEwMjAwNDE4NDRaFw0xNTEwMjEwNDE4NDRaMBcxFTATBgNVBAoTDFBlcmlzY29wZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABKsZFymsiSPOBAgwOwO55ejxkw/1T14X7kTy87t/qYkYhsEkrX1Y4EqpSws3H2d0nJFsAqwEtXnrNtNfGCP1CRSjJzAlMA4GA1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggrBgEFBQcDATAKBggqhkjOPQQDAgNIADBFAiEAicc9uV6OVKKI0h2uRBdODNFnQULzzYdx0E2mDVNb2Z8CIFZ9CmiHuFW4gCUA8rAa+F5RmzZ8bfv21aq1Mex2DFSn', 'endpoint': '', 'type': 'StreamTypeReplay', 'should_log': False, 'publisher': '', 'read_only': True, 'auth_token': 'SygT3wu1U14HV8HdFO61fz_g8hgIRw5qlCtJTfLbdzk=', 'subscriber': 'sub-c-642f220c-d70e-11e3-93e0-02ee2ddab7fe', 'replay_url': 'https://replay.periscope.tv/YG5M374FrEG7myW4IH_vfD224yJP84U9RTC86pYBmRVtkGrONRNk0MHm4FfvkhbDg0XVQA0_ObOWkF6MwYMLXA==/playlist.m3u8', 'participant_index': 0, 'session': '1445339164546780398', 'should_verifysignature': True, 'cookies': [{'Expires': '0001-01-01T00:00:00Z', 'Path': '/', 'HttpOnly': False, 'Unparsed': None, 'Name': 'CloudFront-Policy', 'MaxAge': 0, 'RawExpires': '', 'Secure': False, 'Domain': '.periscope.tv', 'Raw': '', 'Value': 'eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L1lHNU0zNzRGckVHN215VzRJSF92ZkQyMjR5SlA4NFU5UlRDODZwWUJtUlZ0a0dyT05STmswTUhtNEZmdmtoYkRnMFhWUUEwX09iT1drRjZNd1lNTFhBPT0qIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDQ1NDI1NTY0fX19XX0'}, {'Expires': '0001-01-01T00:00:00Z', 'Path': '/', 'HttpOnly': False, 'Unparsed': None, 'Name': 'CloudFront-Signature', 'MaxAge': 0, 'RawExpires': '', 'Secure': False, 'Domain': '.periscope.tv', 'Raw': '', 'Value': 'cpjyZ6do535iw07VI6DjZ3qqfn-zjzTyeYG65thaUpBHbKDvWX1q~Xum~nRcS3w3~xa-ri4IR9nh0~WtqYxiEJr5Qz8-hTvHOnseuyvcWHhv-HyBuDlvzr5jL6YjyirH7ifYEroxC7c1zAtV~UuUr1Y0d7-b42jtURdd46BmLc8S0SFrm0rgmNFSUGAnA5Xo8NRAufVUOFHHpdrt043nZybiZpT0hHp5wVBLFi3YiEHKGc9aHsN0sXEBViMKK8llXciafxJjwDpqShRJIx~BxY0FGKtigye9b-F2jl9DG1PQ7YokEnEEXI-I2DlSsj8xGeyg60TnXiPl3wvdgr0leQ__'}, {'Expires': '0001-01-01T00:00:00Z', 'Path': '/', 'HttpOnly': False, 'Unparsed': None, 'Name': 'CloudFront-Key-Pair-Id', 'MaxAge': 0, 'RawExpires': '', 'Secure': False, 'Domain': '.periscope.tv', 'Raw': '', 'Value': 'APKAIHCXHHQVRTVSFRWQ'}], 'channel': 'YG5M374FrEG7myW4IH_vfD224yJP84U9RTC86pYBmRVtkGrONRNk0MHm4FfvkhbDg0XVQA0_ObOWkF6MwYMLXA==', 'signer_token': ''}
EDIT5: ok I fail at reading, because I assumed the name and value should be near each other, but that's not how it works. So, they show up okay, but their values are different, except for CloudFront-Key-Pair-Id
So much fail in this post, on my side:) I ACK!
Just realized that it works fine with youtube-dl Yields a .mp4
error: Unable to open URL: https://api.periscope.tv/api/v2/getAccessPublic (404 Client Error: Not Found)
cmdline: livestreamer --stream-url --http-header "User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17" --retry-open 1 --default-stream best -o "$file" -- "$URL"
$URL used: https://www.periscope.tv/w/aMIwAzgxMjUxMzh8MWVhS2Jkbmp2bWRKWOzNFCgbr8S4SgqVRy_xjaYLpLBPgbCYMbqTvHOBrq-S
livestreamer version used: latest commit, currently: 8dd6a69a9c949d01f1ee9ee2e5e74c7879031e11
Fixes tried(without any effect!), adding user agent to requests: https://github.com/zazdxscf/livestreamer/commit/92b913ff4c2a4d646333ede070f51ff5ba4b7201 https://github.com/zazdxscf/livestreamer/commit/9cbe55c302cf58001d384feb0a3821fdeb712a04
I might be missing something obvious... Any ideas?
EDIT: in trying other urls from other people, the message seems normal: "stream ended." although the url is for replay.periscope.tv , like: " https://replay.periscope.tv/BZPVWsqUDmc7Od-mlVrGcHeEicfgjqNsrs5wF40eBtbaifAXsjaJO_sHmxFUzNR_2nF3QGBBFW0ePHUWNVgiRg==/playlist.m3u8 stream ended. " EDIT4: that "stream ended." was a msg from my custom batch file, ignore that. The actual message from livestreamer is nothing (except the stream url) and exit code is 0. But visiting that link directly shows: "MissingKeyMissing Key-Pair-Id query parameter or cookie value"
EDIT2:
EDIT3: I guess this means that cookies need to be passed; I'm not looking into this because I don't know python or web... although if I really try I could probably understand how to do it by looking at the twitch code; but I figure someone else could do it in like 30 mins, instead of 2 days what it would take me.
example cmd: $ livestreamer --stream-url --http-header "User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.5.17 (KHTML, like Gecko) Version/8.0.5 Safari/600.5.17" --retry-open 1 --default-stream best -o /tmp/moo -- https://www.periscope.tv/w/aMLmFDU2MTk3OTh8MU93R1dqenlZWHFLURRGIvjmX1PVjPrefUsOyKIhU7boXxPyZ1Och80RENrD
output is: https://replay.periscope.tv/sPXfchOQzQNum9AW-1Gbhty3qUpPD4bw88efDhc4lxw_CgkZuGPQXvApOEgX5sBPHm-uMI0cAgFV1blPnG6Ogg==/playlist.m3u8
exit code: 0 file /tmp/moo is not created.