Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MediaDBPythonScripte
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SI-Projekt
MediaDBPythonScripte
Commits
b97bdf81
Commit
b97bdf81
authored
Mar 14, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
7c081c1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
36 deletions
+38
-36
media.class.php
media.class.php
+38
-36
No files found.
media.class.php
View file @
b97bdf81
...
@@ -354,49 +354,51 @@ class Media {
...
@@ -354,49 +354,51 @@ class Media {
$xml
=
simplexml_load_string
(
$xmlstring
);
$xml
=
simplexml_load_string
(
$xmlstring
);
$json
=
json_encode
(
$xml
,
JSON_PRETTY_PRINT
);
$json
=
json_encode
(
$xml
,
JSON_PRETTY_PRINT
);
$array2
=
json_decode
(
$json
,
TRUE
);
$array2
=
json_decode
(
$json
,
TRUE
);
foreach
(
$array2
[
"File"
][
"track"
]
as
$key
=>
$value
)
{
if
(
isset
(
$array2
[
"File"
][
"track"
])){
//echo " ".$key." ".$value["@attributes"]["type"].PHP_EOL;
foreach
(
$array2
[
"File"
][
"track"
]
as
$key
=>
$value
)
{
switch
(
$value
[
"@attributes"
][
"type"
])
{
//echo " ".$key." ".$value["@attributes"]["type"].PHP_EOL;
case
"General"
:
switch
(
$value
[
"@attributes"
][
"type"
])
{
$array
[
"vcodec"
]
=
str_replace
(
"Matroska"
,
"mkv"
,
$value
[
"Format"
]);
case
"General"
:
$array
[
"duration"
]
=
$this
->
getRunTime
(
$value
[
"Duration"
]);
$array
[
"vcodec"
]
=
str_replace
(
"Matroska"
,
"mkv"
,
$value
[
"Format"
]);
$array
[
"totalbitrate"
]
=
round
(
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"Mbps"
,
""
,
$value
[
"Overall_bit_rate"
])))
*
1024
,
0
);
$array
[
"duration"
]
=
$this
->
getRunTime
(
$value
[
"Duration"
]);
break
;
$array
[
"totalbitrate"
]
=
round
(
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"Mbps"
,
""
,
$value
[
"Overall_bit_rate"
])))
*
1024
,
0
);
case
"Video"
:
break
;
$array
[
"width"
]
=
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"pixels"
,
""
,
$value
[
"Width"
])));
case
"Video"
:
//TODO Resolution aus diesen werten neusetzen
$array
[
"width"
]
=
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"pixels"
,
""
,
$value
[
"Width"
])));
$array
[
"height"
]
=
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"pixels"
,
""
,
$value
[
"Height"
])));
//TODO Resolution aus diesen werten neusetzen
break
;
$array
[
"height"
]
=
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"pixels"
,
""
,
$value
[
"Height"
])));
case
"Audio"
:
break
;
if
(
isset
(
$value
[
"Language"
])){
case
"Audio"
:
if
((
$value
[
"Language"
]
==
"Deutsch"
)
OR
(
$value
[
"Language"
]
==
"German"
)){
if
(
isset
(
$value
[
"Language"
])){
$array
[
"acodecger"
]
=
$value
[
"Format"
];
if
((
$value
[
"Language"
]
==
"Deutsch"
)
OR
(
$value
[
"Language"
]
==
"German"
)){
$array
[
"abitrateger"
]
=
round
(
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"Kbps"
,
""
,
$value
[
"Bit_rate"
]))),
0
);
$array
[
"acodecger"
]
=
$value
[
"Format"
];
$array
[
"channelsger"
]
=
str_replace
(
" channels"
,
""
,
$value
[
"Channel_s_"
]);
$array
[
"abitrateger"
]
=
round
(
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"Kbps"
,
""
,
$value
[
"Bit_rate"
]))),
0
);
if
(
!
is_numeric
(
$array
[
"channelsger"
])){
$array
[
"channelsger"
]
=
str_replace
(
" channels"
,
""
,
$value
[
"Channel_s_"
]);
$array
[
"channelsger"
]
=
substr
(
$array
[
"channelsger"
],
strripos
(
$array
[
"channelsger"
],
"/"
)
+
1
);
if
(
!
is_numeric
(
$array
[
"channelsger"
])){
if
(
!
is_numeric
(
$array
[
"channelsger"
])){
echo
$this
->
Console
->
error
(
"channelsger ist nicht Numerisch!"
)
.
PHP_EOL
;
$array
[
"channelsger"
]
=
substr
(
$array
[
"channelsger"
],
strripos
(
$array
[
"channelsger"
],
"/"
)
+
1
);
file_put_contents
(
"./phpTestout/imdbID/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelsger ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
if
(
!
is_numeric
(
$array
[
"channelsger"
])){
return
false
;
echo
$this
->
Console
->
error
(
"channelsger ist nicht Numerisch!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/imdbID/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelsger ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
}
}
}
}
else
if
((
$value
[
"Language"
]
==
"Englisch"
)
OR
(
$value
[
"Language"
]
==
"English"
)){
else
if
((
$value
[
"Language"
]
==
"Englisch"
)
OR
(
$value
[
"Language"
]
==
"English"
)){
$array
[
"acodeceng"
]
=
$value
[
"Format"
];
$array
[
"acodeceng"
]
=
$value
[
"Format"
];
$array
[
"abitrateeng"
]
=
round
(
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"Kbps"
,
""
,
$value
[
"Bit_rate"
]))),
0
);
$array
[
"abitrateeng"
]
=
round
(
trim
(
str_replace
(
" "
,
""
,
str_replace
(
"Kbps"
,
""
,
$value
[
"Bit_rate"
]))),
0
);
$array
[
"channelseng"
]
=
str_replace
(
" channels"
,
""
,
$value
[
"Channel_s_"
]);
$array
[
"channelseng"
]
=
str_replace
(
" channels"
,
""
,
$value
[
"Channel_s_"
]);
if
(
!
is_numeric
(
$array
[
"channelseng"
])){
$array
[
"channelseng"
]
=
substr
(
$array
[
"channelseng"
],
strripos
(
$array
[
"channelseng"
],
"/"
)
+
1
);
if
(
!
is_numeric
(
$array
[
"channelseng"
])){
if
(
!
is_numeric
(
$array
[
"channelseng"
])){
echo
$this
->
Console
->
error
(
"channelseng ist nicht Numerisch!"
)
.
PHP_EOL
;
$array
[
"channelseng"
]
=
substr
(
$array
[
"channelseng"
],
strripos
(
$array
[
"channelseng"
],
"/"
)
+
1
);
file_put_contents
(
"./phpTestout/imdbID/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelseng ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
if
(
!
is_numeric
(
$array
[
"channelseng"
])){
return
false
;
echo
$this
->
Console
->
error
(
"channelseng ist nicht Numerisch!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/imdbID/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelseng ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
}
}
}
}
}
}
break
;
break
;
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment