Jump to content
Fivewin Brasil

Para quem gosta de filmes


sistem

Recommended Posts

Sistem, não entendi! Não baixou filme nenhum, e sim uma JPG no meu PENDRIVE em F:\ no seu caso era E:\

O que está errado aqui, já que você não postou commpleto.

#include "FiveWin.ch"
	static oWnd
	//----------------------------------------------------------------//
	function Main()
	   local oBar, cRequest
	   cRequest := ( "http://www.omdbapi.com/?t=Mr.+Sardonicus&apikey=777fbcc4" )
	   DEFINE WINDOW oWnd TITLE "Baixar Filmes"
	   DEFINE BUTTONBAR oBar _3D OF oWnd
	   DEFINE BUTTON OF oBar ACTION( httpFilmes( cRequest ) )
	   SET MESSAGE OF oWnd TO "Baixar Filmes" NOINSET CLOCK DATE KEYBOARD
	   ACTIVATE WINDOW oWnd
	return nil
	FUNCTION httpFilmes( cRequest )
	   LOCAL oHttp, aArray, cResp
	   // DEFAULT cRequest := "http://www.omdbapi.com/?t=Mr.+Sardonicus&apikey=777fbcc4"
	   Try
      oHttp := CreateObject( "Microsoft.XMLHTTP" )
   Catch
      MsgInfo( "erro XMLHTTP" )
   End
	   oHttp:Open( 'GET', cRequest, .F. )
   oHttp:SetRequestHeader( "Content-Type", "application/json" )
   oHttp:Send()
	   IF oHttp:Status != 200
	      Msgstop( Alltrim( str(oHttp:Status ) ) + "-" + oHttp:StatusText , "Erro" )
	      RETURN nil
	   ENDIF
	   Try
	      cResp := oHttp:ResponseBody
	   Catch
	      MsgInfo( "erro responsebody" )
	      RETURN nil
	   End
	   Hb_jsondecode( cResp, @aArray )
	   IF aArray == nil
	      Msgstop( "Erro ao retornar os dados." )
	      RETURN nil
	   ENDIF
	   IF Alltrim( aArray["Response"] ) = "False"
	      Msgstop( Alltrim( aArray["Response"] ) + "-" + Alltrim( aArray["Error"] ) )
	      RETURN nil
	   ENDIF
	   ? "Title: " + Alltrim( aArray["Title"] ) + CRLF + ;
      "Type: " + Alltrim( aArray["Type"] ) + CRLF + ;
      "Year: " + Alltrim( aArray["Year"] ) + CRLF + ;
      "Released: " + Alltrim( aArray["Released"] ) + CRLF + ;
      "Runtime: " + Alltrim( aArray["Runtime"] ) + CRLF + ;
      "Production: " + Alltrim( aArray["Production"] ) + CRLF + ;
      "Director: " + Alltrim( aArray["Director"] ) + CRLF + ;
      "Poster: " + Alltrim( aArray["Poster"] ) + CRLF + ;
      "Plot: " + Alltrim( aArray["Plot"] ) + CRLF + ;
      "Language: " + Alltrim( aArray["Language"] ) + CRLF + ;
      "Country: " + Alltrim( aArray["Country"] ) + CRLF + ;
      "Actors: " + Alltrim( aArray["Actors"] ) + CRLF + ;
      "Awards: " + Alltrim( aArray["Awards"] ) + CRLF + ;
      "Genre: " + Alltrim( aArray["Genre"] ) + CRLF + ;
      "Writer: " + Alltrim( aArray["Writer"] )
	   Dowlfile( Alltrim( aArray["Poster"] ), "F:\" + Alltrim( aArray["Title"] ) + "." + Right( Alltrim(aArray["Poster"] ),3 ) )
	   xBrowse(aArray)
	RETURN nil
	FUNCTION Dowlfile( cLink, cDest )
	   LOCAL oXMLHTTP, oADODBStream, lOk := .F.
	   oXMLHTTP := Createobject( "Microsoft.XMLHTTP" )
	   oADODBStream := Createobject( "Adodb.Stream" )
   oXMLHTTP:Open( "GET", cLink, .F. )
   oXMLHTTP:Send()
	   IF oXMLHTTP:Status() == 200
	      oADODBStream:Type := 1
      oADODBStream:Open()
      oADODBStream:Write( oXMLHTTP:ResponseBody )
      oADODBStream:Savetofile( cDest, 2 )
	      // ? cDest  // Baixou uma imagem JPG em F:\ correto isso?
	      Msginfo( "Download ok", "Aviso" ) // diz q sim, mas nekas...
	      lOk := .T.
	   ELSE
	      Msgalert( "erro download", "Aviso" )
	      lOk := .F.
	   ENDIF
RETURN lOk

?????????????????

Abs

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

Tenho ficado frustrado ultimamente porque o netflix tem acesso ruim e pode não carregar. Meu amigo falou que a questão é ter um bom acesso a VPN, já imaginou? Ela me aconselhou a comprar vpn neste serviço  Como assistir Netflix americana? e assistir netflix sem problemas. Eu leio o que não sou só eu. Provavelmente tentarei comprá-lo mesmo assim para continuar assistindo meus filmes favoritos.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...