Created
March 19, 2015 09:26
-
-
Save whatvn/c8662291c593484ef0c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def video(gearman_worker, gearman_job): | |
try: | |
pp = pprint.PrettyPrinter(indent=4) | |
pp.pprint(gearman_job.data.decode('utf-8')) | |
print "raw data: " + gearman_job.data | |
print "decode data: " + gearman_job.data.decode('utf-8') | |
today = datetime.date.today() | |
job_data = json.loads(gearman_job.data.decode('utf-8')) | |
.... | |
except Exception,e: | |
.... | |
Output: | |
u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' | |
raw data: | |
decode data: | |
No JSON object could be decoded | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment