Ejemplo n.º 1
0
 /**
  * @param string $fileCode
  * @param string $csrfToken
  *
  * @return array
  */
 private function requestDownloadInfo($fileCode, $csrfToken)
 {
     $request = $this->requestDecorator->decorate(new Request('POST', 'https://www.fshare.vn/download/get'));
     $options = ['form_params' => ['fs_csrf' => $csrfToken, 'DownloadForm[pwd]' => '', 'DownloadForm[linkcode]' => $fileCode, 'ajax' => 'download-form']];
     return json_decode($this->httpClient->send($request, $options)->getBody()->getContents(), true);
 }
Ejemplo n.º 2
0
 /**
  * @param string $folderUrl
  *
  * @return RequestInterface
  */
 private function makeRequest($folderUrl)
 {
     $request = new Request('GET', $folderUrl);
     return $this->requestDecorator->decorate($request);
 }
 /**
  * @param ClientInterface $client
  * @param $csrfToken
  *
  * @return DomNode
  */
 private function doLogin(ClientInterface $client, $csrfToken)
 {
     $request = $this->requestDecorator->decorate(new Request('POST', 'https://www.fshare.vn/login'));
     $options = ['form_params' => ['fs_csrf' => $csrfToken, 'LoginForm[email]' => $this->userEmail, 'LoginForm[password]' => $this->userPassword, 'LoginForm[checkloginpopup]' => 0, 'LoginForm[rememberMe]' => 1, 'yt0' => 'Đăng nhập']];
     return pQuery::parseStr($client->send($request, $options)->getBody()->getContents());
 }