Html5, chuncked video streaming - html5-video

My html-video calls multiple separate request for chunks. seems not like single stream.
When I see that in debugging tools,
As you see, there are 3 different call.
This is the request header,
Accept:*/*
Accept-Encoding:identity;q=1, *;q=0
Accept-Language:ja-JP,en-US;q=0.8
Connection:keep-alive
Cookie:stg_domain_token=oNijQNByftcYnsLGzFZxRyCesLR-GdWKi6a-uKSJJ9060Yk8pwCiUlcHChyf
Host:stg.myhost.com
Range:bytes=32768-
User-Agent:Mozilla/5.0 (Linux; Android 6.0.1; SC-05G Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/54.0.2840.68 Mobile Safari/537.36
X-DevTools-Emulate-Network-Conditions-Client-Id:62626f5b-82c9-48b9-97f5-a7a983e1c3bc
and here is the response header,
accept-ranges:bytes
Connection:keep-alive
Content-Disposition:filename=49976265106__9BB3FA25-04E4-4AF5-903C-9B12CF622567.MOV
Content-Length:324882
content-range:bytes 32768-357649/357650
Content-Type:video/quicktime
Date:Fri, 04 Nov 2016 06:15:06 GMT
Server:Apache
X-Powered-By:PHP/5.6.17
anyone know what I am missing?

Browser won't download entire video or audio file at a time. It downloads them in chunks and plays them one after another.
For your understanding, I'm explaining the headers here.
Request Header
Accept:*/* : Browser will accept any MIME-Types as response.
Range:bytes=32768- : Browser already has the video part, till byte 32767 but requires file from byte 32768.
Response Header
status : 206 : It means the served content is partial (not complete file)
accept-ranges:bytes : Server accepts byte ranges only (which is universal)
Content-Length:324882 : Total content length from requested byte.
content-range:bytes 32768-357649/357650: it is in this format start byte - last byte / total length (from 0 byte to end)
Content-Type:video/quicktime : Type of content

Related

Send request to wordnet

I need to get send a request on wordnet knowing the tar_id (taken from Imagenet) to get the lemma assigned to that tar (e.g., I have a tar with houses, I need to send the request and obtain the lemma written on wordnet "living accommodation").
I used requests.get() first, with the URL. Then BeautifulSoup's parser.
I get the parsed HTML as a return but, there is no reference to the "body", meaning the part of the Noun and hypernyms / hyponyms.
Can you tell me how to get that part of Wordnet parsed with the rest of the page?
This is the URL I'm working on: http://wordnet-rdf.princeton.edu/pwn30/03546340-n
Just use the JSON endpoint.
For example:
import requests
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:96.0) Gecko/20100101 Firefox/96.0",
}
url = "http://wordnet-rdf.princeton.edu/json/pwn30/03546340-n"
data = requests.get(url, headers=headers).json()
print(data[0]["definition"])
Output:
structures collectively in which people are housed
And if you switch the endpoint to
url = "http://wordnet-rdf.princeton.edu/json_rel/03551520-n"
You'll get all the word relation data.

Accessing Request Object in WebAPI 2

I am ruining into ModelBinding Error in WebAPI, I see that primary Key is being Posted back to the Server, but on the Server in the Model Property that Key is always empty.
I decided to inspect it further and see if the Request Object is able to retrieve that value if so i will go ahead and implement my own custom Model Binder. But know i ran into another problem where i cannot figure out howto extract the value using Request Object ?
This should have been fairly simple , but cannot find correct way ?
Here is the Postinformation, with OrgCode_PK being the property giving problem.
Request URL:http://localhost:1398/api/Org/PutOrg
Request Method:PUT
Status Code:404 Primary Key Not found
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:473
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Cookie:sbOverlayID=52335384; __iswl_localhost:1398=0; __ctxpop=1
Host:localhost:1398
Origin:http://localhost:1398
Referer:http://localhost:1398/main.html
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36
X-Requested-With:XMLHttpRequest
Form Dataview sourceview URL encoded
$inlinecount:allpages
OrgCode_PK:ORG6
OrgHeadCode_FK:ORGH12
Code:CBSE-KHN
Name:khkl modified
Description:jhjkh
Address1:hjkh
Address2:jkhkj
CountryCode_FK: edf
CountryName:abyu
StateCode_FK:klh
StateName:yhu
CityCode_FK:hjkh
CityName:khk
ZIP:67u8
RowStatusCode_FK:NEW
RowStatus:NEW ROW
DateCreated:02-06-2014
DateUpdated:02-06-2014
EffectiveDate:02-11-2014
TerminationDate:05-21-2014
CreatedByUserName:jkhkjhkj
UpdatedByUserName:kjkljlk
RowStatusName:NEW ROW
Response Headersview source
Cache-Control:no-cache
Content-Length:41
Content-Type:text/plain; charset=utf-8
Date:Fri, 07 Feb 2014 17:24:52 GMT
Expires:-1
Pragma:no-cache
Server:Microsoft-IIS/8.0
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET
X-SourceFiles:=?UTF-8?B?QzpcUHJvamVjdHNcU01XaXRoQXV0aGVudGljYXRpb25cU000XFNNNFxhcGlcT3JnXFB1dE9yZw==?=
Found this myself
var httpContext = (HttpContextWrapper)Request.Properties["MS_HttpContext"];
var OrgCodePK = httpContext.Request.Form["OrgCode_PK"];

Data encoding when submitting a PDF form using AcroForm technology

When I create a PDF form (for instance using Acrobat) that contains text fields in AcroForm format (PDF dictionaries, no XFA), and I submit the data to a server, how can I specify/retrieve the encoding that will be used?
For instance. When I submit the Chinese glyphs '测试' (test), I receive the following headers and content on the server-side:
accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
content-type: application/x-www-form-urlencoded
content-length: 23
acrobat-version: 10.1.4
user-agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDC; .NET4.0C; AskTbCLA/5.15.1.22229)
accept-encoding: gzip, deflate
connection: Keep-Alive
Song=%b2%e2%ca%d4&Test=
There's no reference to an encoding, except x-www-form-urlencoded. The two glyphs are represented as four bytes: B2 E2 CA D4. After some investigation, I know that B2E2 is the GBK value for the first glyph, and CAD4 the GBK value for the second glyph, but I can't derive this from the request header.
Is it always GBK? I want to change the data encoding by setting a specific key in a dictionary in the PDF, but there doesn't seem to be any. For instance: I would like make sure the PDF always sends Unicode characters instead of GBK.
Note that I've already experimented by changing the default font (and encoding) of the text field. I've also searched ISO-32000-1 for encodings in fields, but all I found was a way to define non-Latin characters for check boxes, and some info about the encoding of an FDF file. None of which answered my questions.
I've just found the answer to my main question myself. I didn't find anything in ISO-32000-1 or the ISO-32000-2 draft, but studying the Acrobat JavaScript reference, I found the cCharset parameter that is available for the submitForm() method. That parameter defines:
The encoding for the values submitted. String values are utf-8,
utf-16, Shift-JIS, BigFive, GBK, and UHC. If not passed, the current
Acrobat behavior applies. For XML-based formats, utf-8 is used. For
other formats, Acrobat tries to find the best host encoding for the
values being submitted. XFDF submission ignores this value and always
uses utf-8.
In other words: in my case GBK was used because it fits best to submit Chinese characters. However, one could force UTF-8 by using the submitForm() JavaScript method using the appropriate value.
Based on this question, I have asked the ISO committee to fix this problem in ISO-32000-2.
As a result, an extra possible entry was added to the table entitled Additional entries specific to a submit-form action in section 12.7.6.2:
CharSet: string
(Optional; inheritable) Possible values include: utf-8, utf-16,
Shift-JIS, BigFive, GBK, or UHC.
Starting with PDF 2.0, this problem will no longer exist.
Update: my suggestion made ISO 32000-2 (aka PDF 2.0):
The CharSet key doesn't exist in ISO 32000-1; it was introduced in ISO 32000-2.

getting directly only the contents after the first nth character in vb.net

Is there any way we could get directly say the 1000 characters after the first 5000 characters, skipping everything before that after sending in an HTTP request to an HTTPS page using either GET or POST in VB.NET?
The reason why I ask this question is because in one of the webpage I am trying the get through my program, the website is sending response data in chunks with the first chunk containing some javascript garbage that I have no interest in, the only data I care is in the second chunk and
I have no idea how to get the second chunk after receiving the first one since it is within the same HTTP request
It would save some time and Internet traffic if I can skip the first chunk that I do not need.
Is that possible or I am just day dreaming?
Many thanks!
ADDED:
Here is how a typical header of the response I am getting from the webpage I am trying to get:
Date: Mon, 20 Jun 2011 13:21:56 GMT
Set-Cookie: JSESSIONID=1AF1AF9EF936E1CB2FA85B750EDC67C4; Path=****some path******; Secure
Content-Type: text/html; charset=ISO-8859-1
Transfer-Encoding: chunked
Set-Cookie: **********some cookie***************
path=/
Vary: Accept-Encoding, User-Agent
Not sure if that helps, but as you can see, the chunk size is not visible to me, there is no "Trailer" in the header as well.
Fun little problem. Look at RANGE in the following GET request.
GET /file.txt HTTP/1.1
Host: localhost
Range: bytes=5000-6000
Connection: Close
Edit: Found a HTTP example.
Here is an example in PHP. (Sorry I couldn't find any VB.NET examples).

Flash Builder: Network Monitor - not showing raw data for AMF?

I've built a basic RPC program using FluorineFX (.NET) on the backend for my AMF service. Everything works fine, i.e. I can make calls to the exposed functions.
However, when I looked at Network Monitor in Flash Builder to further examine the network traffic, and then view the Raw Data for the AMF response, it doesn't seem to be compressed/encoded. Also, the response size matches the non-compressed content. My understanding is that these things would be binary. Is there something wrong with my solution or assumptions?
Example: a response (some line breaks added) containing a short array (notice the unencoded body content):
HTTP/1.1 200 OK
Date: Fri, 27 Aug 2010 15:06:49 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/x-amf
Content-Length: 363
Flex Message (flex.messaging.messages.AcknowledgeMessage)
clientId = 29eb2c7f-974b-4bae-8d28-98d4b4dd0547
correlationId = B556E5C3-5476-A92C-2CEC-B4163ABCD1C8
destination = fluorine
messageId = 92675e09-0bc0-498f-b017-7e601b740563
timestamp = 250290640
timeToLive = 0
body = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
hdr(DSId) = 6b42848939804b7592eb956797d4eef4
It looks like Network Monitor (available only in Flash Builder Premium) doesn't ever actually show raw AMF data. However, I was mostly interested in response size (i.e. for optimization), which is available. The Response Size (bytes) in the Tree View shows the size of unencoded response, but you can get the encoded size from the Content-Length line in the Raw View.