php-snapchat icon indicating copy to clipboard operation
php-snapchat copied to clipboard

No data for video with text

Open mattiz opened this issue 10 years ago • 7 comments

When downloading a video with text, no data is returned. The test was done on a iPhone 4.

mattiz avatar Jan 31 '14 15:01 mattiz

Having the same issue. Seems to not be passing the isMedia check. If i just set return TRUE at the top of that function it downloads data but not in a valid format.

ckanoab avatar Jan 31 '14 22:01 ckanoab

My guess is that the different Snapchat versions have different hash/encryption keys, so we would need to work out what those are, however...

My fix, in snapchat_agent.php:

  1. Change the version back to 6.0.2
14:         const VERSION = '6.0.2';
56:         CURLOPT_USERAGENT => 'Snapchat/6.0.2 (iPhone6,2; iOS 7.0.4; gzip)',
  1. Comment out sending version (or delete the line):
235:        //$data['version'] = self::VERSION;

This was found by trial and error from the login issue, so thanks to NemOry and shgn.

y3kdaniel avatar Feb 02 '14 16:02 y3kdaniel

That works.

ckanoab avatar Feb 03 '14 21:02 ckanoab

But then causes the login issues experienced previously. Random get on non member for the cache

ckanoab avatar Feb 04 '14 23:02 ckanoab

If you have changed all 3 lines, then I am unsure why it is not working for you. In my tests (reading the feed and getting media) it all works fine. You did comment/remove line 235? That is what cured the login issue for me as per shgn suggestion in the other issue.

y3kdaniel avatar Feb 05 '14 00:02 y3kdaniel

the three line changes seemed to work for me, but I sometimes have to rerun the downloads a few times to get everything.

AppliedEllipsis avatar Feb 08 '14 09:02 AppliedEllipsis

I submitted a pull request dealing with this issue. Videos with overlay texts are sent as a zip file containing a transparent PNG (with the text), and the M4V file.

The changes include:

  • Adding an isCompressed method to check after the media checks have failed.
  • Adding unCompress (you can rename to extract if you prefer), that would extract the files, and returns an array consisting of two key-value pair elements. Key would be the filename and value is the content of the file.

Check pull request for more details.

hisham-albeik avatar Jun 14 '14 02:06 hisham-albeik